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:
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:
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:
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.
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
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.
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.
Maybe you need to install URL Rewrite
I had same problem.
Related
I am trying to import an ASP.NET project which I know works and I am trying to build it on local. I imported the solution file in Visual Studio and went ahead and did a Clean and Build on it which went ok. Now I am trying to Publish the project and once I do that, I clicked the run button which says IIS Express and I see the following
HTTP Error 403.14 - Forbidden
Most likely causes:
A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
If I was running this application out of IIS Manager, I know how to resolve this by clicking on the project, clicking Directory Browing and clicking Enable but I don't know how to fix this issue if I am running it from inside Visual Studio.
To resolve the issue you could try one of the below ways:
1)Set the below code in the web.config file:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true" />
</system.webServer>
2)Set the default page for your project:
<system.webServer>
<defaultDocument>
<files>
<add value="pagename.aspx" />
</files>
</defaultDocument>
</system.webServer>
if you are using the MVC site then set default routs.
I'm working on my first real world .Net Core 3.1 Web API and I'm getting an error with the web.config file but don't know what's wrong.
I create the Web API locally and it tests out just fine. I published the project to a local folder and then copied it out to IIS on our STAGE server. When I open IIS and click on any of the icons for the project (in this case I clicked the Logging icon) and I get an error "There was an error while performing this operation" and the file name points to the web.config in my folder structure.
The web.config file is created automatically when I publish the project. Anyone see what the issue could be with the web.config that's causing the problem?
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\AvTechAPI.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 24142d05-13a1-4655-b2b8-8f8456003615-->
Windows IIS
Solution: Install the hosting bundle.
Reason: Although the SDK normally contains the runtime, however, it seems the SDK installer is not registering the runtime correctly on the server.
Workaround (not recommended):
Change AspNetCoreModuleV2 to AspNetCoreModule inside web.config.
Azure platform hosting
Install the .NET Core runtime extension by selecting Extensions and then installing .NET Core Runtime.
I am running IIS under Windows Server 2016 and I'm trying to run an ASP.Net core 3.1 application but I can't get past this error:
500.19 error
(The language in the picture is Hungarian, but it contains no useful information whatsoever, just an example)
Here is my web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\Minibizz.Routing.Web.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
What am I missing?
P.S.: The web.config was created by Visual Studio 2019.
The reason behind the issue:
That error message goes on to say what exactly is bad about your configuration file, hence you should refer the “Config Error” and “Config Source” sections. This problem occurs because of the ApplicationHost.config file or the Web.config file contains a malformed or unsupported XML element.
if you are using url rewrite rule then install url rewrite Extention of iis. Enable ANCM logging, ie. set stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout\" (I think the path needs to end by a backslash), then run the web app and see if something gets logged into the stdout folder. Verify that the log directory exists at the path referenced by the web config. If it does not, create it. The path shown in your config would place the "logs" directory in the root folder of the deployed site. Verify that the application pool has to write access to the logs directory.
Make sure you installed the .net bundle.check that you installed below iis feature:
You may also need to verify that the path to the dotnet executable exists in the deployment machine's environment variables. To check this, first find the path where dotnet.exe is installed. It is generally located in either C:\Program Files\dotnet or C:\Program Files (x86)\dotnet. Once you know the path, ensure that the path exists in your Environment Variables.
The web.config content seems to be correct. If you use a clean web.config copy, does the problem persist? If the issue can be solved by replacing web.config with clean configuration content, then the problem is exactly with this web.config. In this case, I suggest you remove parts of the web.config content to narrow down the issue. If the pages show correctly after you remove one section, then the problem is with that section. You need double-check what's wrong with the section and update the correct configuration.
If the problem remains even with clean web.config content, I suggest you access other pages in different folders in your site to see if the problem still exists.
you could refer this below link for how to publish asp.net core site in iis:
https://learn.microsoft.com/en-us/aspnet/core/tutorials/publish-to-iis?view=aspnetcore-3.1&tabs=visual-studio
I'm struggling to deploy any MVC application onto IIS in a windows 10 environment.
I always get an HTTP error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid. It goes on to suggest there is a problem reading the configuration file.
On a similar post on this site it was suggested that asp.net was not installed but I'm certain that I've done it. I've used the Aspnet_regiis.exe tool and followed the instruction on the link below.
http://www.jammer.biz/enable-asp-net-on-windows-10/
The webconfig file as it came out of visual studio 2017 when I published is as follows:
<?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=".\HelloWorld.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
<!--ProjectGuid: e88818e3-e6fd-4105-94cc-5be77ed93582-->
I've not edited it since none of the tutorials I've followed it tell me to.
I've made sure that full access rights on the folder are granted.
Here is the error message as seen from in IIS.
Why is IIS struggling to read my config file?
Thanks in advance.
Ian
I had this same issue when trying to publish a .NetCore2.0 mvc app. The solution can be found here: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-2.1&tabs=aspnetcore2x
In my case, I did not have the .NET Core Hosting Bundle installed.
I have followed (as far as I can tell) all of the instructions located here for a self contained .NET core deployment:
https://learn.microsoft.com/en-us/aspnet/core/publishing/iis
According to the page, I only need to run this command to get the module installed in IIS
DotNetCore.1.0.3_1.1.0-WindowsHosting.exe OPT_INSTALL_LTS_REDIST=0 OPT_INSTALL_FTS_REDIST=0
My web.config looks like this:
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\mypackage.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
But, the dotnet.exe is no where to be found on my server. What am I missing?
You seem to have published your application as a portable application (i.e. one that is trying to using shared runtime) but did not install the runtime. You either need to install the runtime, or you need make changes to your application (project.json/*.csproj really) to make it standalone in which case when publishing it will contain the runtime with it.
From web.config perspective - when publishing a standalone application the processPath is {application}.exe instead of dotnet