asp.net.netiiswindows-server-2012-r2

IIS (There was an error while performing this operation)


I receive There was as error while performing this operation error referring to web.config. I follow below configuration:

  • OS is Windows server 2012 R2 with IIS version 8.5.

  • URL Rewrite 2.1 module is installed on the machine.

  • IIS_IUSRS has full access to the directory.

  • Application Initialization module is installed

  • .Net CLR Version v4.0.30319 and managed pipeline mode is integrated.

  • IIS configuration is as below:

  • enter image description here

  • enter image description here
    Web config is as below:

<?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <system.webServer>
        <handlers>
          <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
        </handlers>
        <aspNetCore processPath="dotnet" arguments=".\MES.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
      </system.webServer>
    </configuration>
    <!--ProjectGuid: e8701310-485f-4f88-b7d0-1473d07238ac-->

browsing the page I receive below message: enter image description here However, when I remove

<aspNetCore processPath="dotnet" arguments=".\MES.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" /> 

from web.config I don't receive (There was as error while performing this operation) error but I get below error: enter image description here


Solution

  • Add <aspNetCore> back and also install ASP.NET Core module on this machine, as suggested in this Microsoft article.

    I also wrote a tool to better automate such detection.