I'm using IIS Express to host my website and API both of which are ASP.NET Core apps. When I look at my HTTP network logs using Fiddler, I always forget what port belongs to which app. To solve this, I would like to change the port number that my apps currently use to a number that is more memorable.
For example, I want my UI website to use port 50000 and my internal API to use 50001.
Intuition tells me to change the "sslPort" and "launchUrl" to 50000 and 50001 respectively but that doesn't work.
For example, this is my current launchSettings.json
file for my ASP.NET
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iis": {
"applicationUrl": "http://localhost",
"sslPort": 0
},
"iisExpress": {
"applicationUrl": "http://localhost:29751",
"sslPort": 44371
}
},
"profiles": {
"Development": {
"commandName": "IISExpress",
"launchUrl": "https://localhost:44371/"
}
}
}
Changing it to this doesn't work
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iis": {
"applicationUrl": "http://localhost",
"sslPort": 0
},
"iisExpress": {
"applicationUrl": "http://localhost:29751",
"sslPort": 50000
}
},
"profiles": {
"Development": {
"commandName": "IISExpress",
"launchUrl": "https://localhost:50000/"
}
}
}
Question: Why doesn't this change work? How do I change the port number?
Many thanks...
To change the port the application is using, Open the file lunchSetting. json. You will find it under the properties folder in your project and as shown below. Inside the file, change applicationUrl port (below is set to 5000) to a different port number and save the file.
By default IIS Express uses port 8080, but you can use any HTTP port you like. You can also run these from the WIndows Command line in the Web Connection install folder by running Console.exe .
In Solution Explorer, click the name of the application. In the Properties pane, click the down-arrow beside Use dynamic ports and select False from the dropdown list. This will enable editing of the Port number property. In the Properties pane, click the text box beside Port number and type in a port number.
I found the solution. When changing the SSL port number, it must be within 44300 - 44399 otherwise it won't work. Reference: developercommunity.visualstudio.com/comments/43139/view.html. @Tseng, please remove the "duplicate" flag
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With