2

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.

2 Answers2

0

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:

enter image description here

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

Jalpa Panchal
  • 8,251
  • 1
  • 11
  • 26
  • Every Web Server Feature is installed under the category. If I remove the web.config and try to load the site it just shows all the files in the folder. Also whatever modification I do with the web.config it doesn't change because the error remains the same. I set the stdlogout to true, but no file is created. And yes, IIS has total permission over the folder(s), even the Inetpub. – Jeremy Gyovai-Rafa Dec 18 '19 at 10:53
  • I also found that removing this line: `````` will remove the error and show only folders. – Jeremy Gyovai-Rafa Dec 18 '19 at 11:37
  • @JeremyGyovai-Rafa did you install the web hosting bundles? – Jalpa Panchal Dec 19 '19 at 08:52
  • Yes, I have the dotnet core 3.1 hosting bundle. – Jeremy Gyovai-Rafa Dec 19 '19 at 13:50
  • First of all, you need to install ASP.NET Core Module in web server https://aka.ms/dotnetcore-2-windowshosting.Then install either SDK or Runtime in web server https://dotnet.microsoft.com/download.please refer this link https://stackoverflow.com/questions/50612351/how-do-i-configure-a-net-core-api-to-work-in-iis. – Jalpa Panchal Dec 20 '19 at 05:27
  • As I already mentioned, I have dotnet core 3.1 runtime, aspnet 3.1 runtime, 3.1 hosting bundle, and desktop 3.1 runtime too, everything under the downloads section. – Jeremy Gyovai-Rafa Dec 20 '19 at 20:10
  • @JeremyGyovai-Rafa 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. provide the generated log here. – Jalpa Panchal Dec 25 '19 at 07:17
  • I already tried that, the folders gets generated but nothing gets logged. The folder remains empty. – Jeremy Gyovai-Rafa Dec 26 '19 at 08:45
  • did you tried to use application pool identity network service or local system? – Jalpa Panchal Dec 26 '19 at 09:52
0

It seems that when there is an error "500.19 - internal server error", with "error code 0x8007000d", from web.config, and the specification in the lower box just reads "Config source -1: 0:" (which I would guess is exactly what the original poster's error message in Hungarian says), it is usually due to a config section that is not at all supported by the server (as opposed to a syntax error or an unsupported parameter).

See this discussion: https://social.msdn.microsoft.com/forums/en-US/06556db0-3597-4122-b365-12bcbc10740e/error-50019-error-code-0x8007000d-config-source-1-0?forum=iistroubleshooting

In my case, the IIS URL Rewrite Module was referenced in the web.config file but missing from the server, causing this error. After downloading the installation package from https://www.iis.net/downloads/microsoft/url-rewrite and installing the module, the error went away.

Otto G
  • 670
  • 7
  • 14