Why does SpaServices always seem to add a random port?
Since the update of Core 2.1, there have been new Spa templates. I've tried out the Angular one, and updated it to Angular 6. Now everything works fine, except that I need to manually build everytime I make changes. This is strange because it used to work well with Angular 5 before. I've looked up a bit into this and I spotted this in the logs:
Microsoft.AspNetCore.SpaServices:Information: > test@0.0.0 start C:[redacted]\Projects\test\test\ClientApp ng serve "--port" "62206"
** Angular Live Development Server is listening on localhost:62206, open your browser on http://localhost:62206/ **
As you can see, it adds "--port" "62206" to the ng serve. When I later go to http://localhost:62206/, I can see my website and live updates seem to be working there!
I've tried restarting my server a few times and I noticed that each time it uses a different port. It almost seems random.
What I find even more infuriating is that my application is actually running on port 66230! Why doesn't SpaServices just use the IIS port? And is there a way to change it manually? Because if I have to wait for my server to start, scroll through the output to find the port it chose, type that in my address so I can debug, I will lose a lot of time and effort
0 comments:
Post a Comment