After switching from IIS Express to IIS, I got into trouble when I tried to start the ASP.NET Core web application through Visual Studio.
When hitting F5, instead of building and launching my application, I got the following error message:
Unable to start process C:\Program Files\dotnet\dotnet.exe. The web server request failed with authentication failure 401, Unauthorized.
Luckily sometimes error messages can be meaningful and enabling anonymous authentication in the launchSettings.json indeed solved the problem:
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:53125",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "local"
}
}
}
}