Error when running a .net core web app with React.js on IIS 10

1

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?

reactjs
iis
.net-core
asked on Stack Overflow Sep 4, 2020 by jgnz

1 Answer

1

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://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1

answered on Stack Overflow Sep 7, 2020 by Jalpa Panchal

User contributions licensed under CC BY-SA 3.0