Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 699
Aboriginal Avatar asked Sep 13 '17 23:09

Aboriginal


4 Answers

enter image description here

This error occurred for me when trying to double-click on the Logging module for any site with a bad Web.config.

"Bad" includes Web.configs that just have a module IIS doesn't understand - in my case, IIS 10 couldn't understand the <rewrite> tag, and exploded with this extremely confusing error.

You can verify this by just commenting out the contents of your Web.config. The error goes away - then just gradually reduce how much is being commented out until you find the culprit, and track down that solution.

like image 151
Chris Moschini Avatar answered Oct 22 '22 15:10

Chris Moschini


Add <aspNetCore> back and also install ASP.NET Core module on this machine,

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/aspnet-core-module?tabs=aspnetcore2x

I also wrote a tool to better automate such detection,

https://www.jexusmanager.com/tutorials/oob-500.html

like image 40
Lex Li Avatar answered Oct 22 '22 17:10

Lex Li


This error is typically caused by a reference inside the web.config which cannot be resolved by the dotNet runtime.

If you are using dotNet core, AND you installed the dotNet core hosting bundle BEFORE you configured your server to run IIS you may get this error.

To fix it in this case, you need to re-run the dotNet core hosting bundle installer AGAIN, in "repair mode"

As described in the box entitled "Important", here.

like image 7
Geeb Avatar answered Oct 22 '22 17:10

Geeb


I had this problem with .NET Core 2.1. I installed 2.1 SDK (v2.1.301) and as Microsoft says Hosting Bundle now installs with SDK, but in my case this did't work. This problem disappeared only when I installed 2.1 Runtime (v2.1.1) for Hosting Bundle Installer.

enter image description here

like image 2
Viacheslav Yankov Avatar answered Oct 22 '22 15:10

Viacheslav Yankov