17 December, 2020

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode

 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.

Background of the Issue: 

Above error may occur with any version of .Net or .Net Core and Any version of Visual Studio as well. I faced this issue while creating a POC on .Net Core 3.1 as well as recently while working with .Net 5. 

What is the root cause of Issue ? 

Root cause of the issue is that scaffolding template that comes with .Net as well as the settings of Visual studio which does not create web.config while choosing the web project specially .Net core versions.  
You need to have at least this web.config as bare mininum requirement in case no authentication is required and no authorisation is required. Depending upon the requirement you may comment/uncomment the codes after creating the web.config file manually in Root directory of website. Do not confuse it with wwwroot,  take a look on below snapshot to be more clear : 

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <!-- To customize the asp.net core module uncomment and edit the following section. 
  For more info see https://go.microsoft.com/fwlink/?linkid=838655 -->
  <system.webServer>
    <!--<handlers>
      <remove name="aspNetCore" />
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
    <security>
      <authentication>
        <anonymousAuthentication enabled="false" />
        <windowsAuthentication enabled="true" />
      </authentication>
    </security>-->
    <validation validateIntegratedModeConfiguration="false"/>
  </system.webServer>
</configuration>


Location of  web.config File : 



Happy Coding...!!!