Reputation: 874
I have this setup to change the URL to 5002.
After running, this the result.
Upvotes: 1
Views: 1284
Reputation: 4430
From our friends at MS support:
"IISExpress uses http.sys for its communication and it requires SSL ports to be registered as Administrator. To avoid running Visual Studio as administrator, IIS Express reserves the port range 44300 - 44399 when it is installed. As long as you select a port within this range (which is what VS does) you do not need to run IISExpressAdminCmd to register the URL."
via support link: https://developercommunity.visualstudio.com/content/problem/39430/changing-port-number-in-a-web-project-does-not-imm.html
Solution #1 Use IIsExpressAdminCmd.exe to register the URL
From cmd prompt go to directory C:\Program Files (x86)\IIS Express
Run IISExpressAdmiCmd to register the url IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:5002/ -UseSelfSigned
Solution #2 Run VS under admin context
Solution #3 Switch the port to a pre-registered one 44300 - 44399
Upvotes: 2
Reputation: 6884
A few things to try;
Search through your project code (using find all) looking for instances of "5002" or whatever your port number was previously. You will be looking for references in generated code rather than code you have created yourself.
Try with a difference browser (Chrome / Firefox etc).
Shut down any other running applications.
Try running without https. If this works you can focus your effort on getting the developer certificates working.
Stop and start visual studio (its annoying how often this solves anomalies!)
Check that the IIS express instance is running in the tray - click on the tray, locate the respective running application and click browse.
Create a completely clean application using port 5002 and compare the two solutions to relevant differences.
Reboot and try again - in case there are any other applications locking this port number.
Upvotes: 0