Issue: default URL is not working properly when deploying ASP.NET Core 8 MVC on IIS (Windows Server).
In my ASP.NET Core 8 MVC application, I specified the launchUrl in the launchSettings.json file. It works correctly in local development - when I start the application, it automatically opens the specified launch URL (e.g., http://localhost:20395/Auth/Login).
However, after deploying the application to IIS on a Windows Server, the application opens with http://localhost/MyAppName instead of the expected http://localhost/MyAppName/Auth/Login.
What could be the reason for this behavior, and how can I configure IIS to use the correct launch URL?
My launchSettings.json:
{
"profiles": {
"http": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"launchUrl": "Auth/Login",
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:5298"
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "Auth/Login",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOTRELOAD_MAXRULES": "15000"
}
},
"WSL": {
"commandName": "WSL2",
"launchBrowser": true,
"launchUrl": "http://localhost:5298",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_URLS": "http://localhost:5298"
},
"distributionName": ""
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:20395",
"sslPort": 0
}
}
}