问题
I created an ASP.NET web application MVC Core 2.2 project. Then I ran it in IIS Express. But I received the following error:
HTTP Error 500.24 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
Most likely causes: system.web/identity@impersonate is set to true.
Things you can try: If the application supports it, disable client impersonation. If you are certain that it is OK to ignore this error, it can be disabled by setting system.webServer/validation@validateIntegratedModeConfiguration to false.
This is my lunchSetting.json code:
{
"iisSettings": {
"windowsAuthentication": true,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:50764",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "http://localhost:50764",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"WebApplication2": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:5001;http://localhost:5000"
}
}
}
回答1:
Something is wrong with your setup. "windowsAuthentication": true
shouldn't be there. It's set to false
by default, unless you are trying to set and use Windows Authentication. Setting up Windows Authentication requires special steps, including having a web.config
file with forwardWindowsAuthToken="True"
and .UseIISIntegration()
in program.cs file. If you are not trying to do that, just set "windowsAuthentication": false
.
回答2:
Clearly not the poster's problem, since he wrote he fixed it changing .NET Core version; but I'm posting what worked for me, just in case.
Open IIS and find your default website:
Then open the configuration editor:
The configuration editor opens; click the drop-down to the top left and pick system.web/identity:
Set impersonate to false:
And you're good to go!
来源:https://stackoverflow.com/questions/54727477/http-error-500-24-internal-server-error-system-web-identityimpersonate-is-s