Open launchSettings.jsonand
specify the port in applicationUrl for configuration that you use
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:10042",
"sslPort": 44353
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"BackEnd": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:10040;http://localhost:10041"
}
}
}
or in Visual Studio, right-click on the project -> Properties, click on Debug and change the port number next to APP URL under the Web Server Settings
