2

I have a web app based on .net core v2.1 with a React.js front-end, which I'm trying to host on IIS 10. The app runs fine via Visual Studio (2017), however when I publish the app and host via IIS, I get the following error:

Error image

HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

Error Code 0x8007000d

The web.config file was generated during the publish; I have not modified it:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\SkillsMatrix.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: ea8a300c-5bb6-4a29-a8d2-d13dddbbac1d-->

This same error happens if I start a brand new project via VS, do not add any code, and publish it to IIS...

I have tried:

  • Giving access to the folder/file to the IIS_IUSRS user group
  • Removing app.UseHttpsRedirection(); in StartUp.cs

Does anyone have any suggestions for how I can clear this error and host my app?

1 Answer 1

3

You could try the below steps to resolve the issue:

1)Make sure you download and install the .net core hosting bundle and runtime.

https://dotnet.microsoft.com/download/dotnet-core/3.1

2)Make sure that the Application Pool > Process Model > Identity is set to ApplicationPoolIdentity or your custom identity has the correct permissions to access the application's deployment folder.

3)Set the application pool set the .NET CLR version to No Managed Code:

enter image description here

4)Confirm that you have enabled the proper server role. See IIS Configuration.

you could the below link for more detail:

https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, needed to install the hosting bundle. Also, needed to update the Modules parameter in the web.config as per stackoverflow.com/questions/51336791/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.