0

I am trying to publish my asp.net core project on IIS server. But again and again I am meeting the same error defined below and in attached picture too.

HTTP Error 500.19 - Internal Server Error Config Error Cannot read configuration file due to insufficient permissions Config File \?\C:\Users\PC\Desktop\publish\web.config

Error Image

My web.config file looks like this:

<?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=".\CourseGamePlay.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 9F678AE2-FBFD-4FD4-8DBF-5811C4E16705-->

Help me out in it to solve this error. Thanks in advance.

  • Does this answer your question? [IIS 500.19 with 0x80070005 The requested page cannot be accessed because the related configuration data for the page is invalid error](https://stackoverflow.com/questions/9216158/iis-500-19-with-0x80070005-the-requested-page-cannot-be-accessed-because-the-rel) – Lex Li May 02 '21 at 14:22

1 Answers1

0

According to your description, I guess you may not set the enough permission for IIS application pool identity to access the web.config file.

I suggest you could try to follow below steps to modify the web.config permission to let the IIS application pool access.

1.Open Windows Explorer

2.Select the web.config file

3.Right click the file and select Properties

4.Select the Security tab

5.Click the Edit button and then Add button

6.Click the Locations button and make sure that you select your computer.

enter image description here

7.Enter IIS AppPool\DefaultAppPool in the Enter the object names to select: text box.

8.Click the Check Names button and click OK.

Brando Zhang
  • 19,106
  • 6
  • 28
  • 54