skip to Main Content

I did the following steps:

  1. Reinstall Windows server 2008 R2 SP1

  2. Install iis

  3. Install VS 2022 17.1.4 and created new ASP.Net core app (with standard template) and publish

    But when I tried to open the site I got an error

500 – internal server error.

When I tried to double click on the "Error pages .NET" icon in IIS manager, I got an error on reading of

File: ?D:monitor22web.config

Access to the folder " ?D:monitor22" and pool credentials is made from administrator. How I can solve the problem?

2

Answers


  1. There is no problem with web.config file. you just need to give permission to read of file to IIS Users

    1. On the IIS, open Windows Explorer, and select the directory of the web application.
    2. Right-click and select Properties.
    3. Select the Security tab.
    4. Select the IIS_IUSRS user and click Advanced.
    5. Select Full control permission and click OK.

    For reference check following link Cannot read configuration file due to insufficient permissions

    check it and if this not okay to solve your problem then there is may be change in application pool.
    For that,

    1. Open the IIS Manager.
    2. In the left pane, right-click on the Application Pools folder then click Add Application Pool.
    3. Now fill the name as your project name
    4. In the left pane, expand the Application Pools.
    5. Right-click Trend, then select Advanced Settings.
    6. Scroll down to the Identity field and select Local System from the dropdown list.
    7. For the Predefined option, select Local System from the dropdown list and click okay.
    8. In the left pane, expand the Web Sites folder.
    9. Right-click OfficeScan, then click Manage Website > Advanced Settings.
    10. For Application pool, select Trend from the dropdown list. If you get an inheritance override, select all and click okay.
    11. Restart the IIS Admin Service. Perform the steps below.
      • Windows + R
      • In the Open field, type "services.msc", and then click OK.
      • Look for and select IIS Admin Service, and click the Restart link, located in the left pane.

    For Reference check the following link https://success.trendmicro.com/dcx/s/solution/1098768-cannot-read-configuration-file-appears-on-http-error-500-19-when-accessing-the-worry-free-busin?language=en_US

    Hope this will help you. The first option was helped for me when I stuck in same issue.

    Login or Signup to reply.
  2. First, ensure that the ASP.NET Core application’s application pool is configured to run under an account with sufficient permissions to access the application directory.

    Open IIS Manager >> Select the application pool used by your site >> Click "Advanced Settings" in the Actions pane on the right >> Check "Identity" under the "Process Model" section. By default it is set to "ApplicationPoolIdentity", which should be the recommended setting.

    Then you need to grant Read permission to the IIS_IUSRS group for the Web.config file indicated in the error message. Even if there is no config file at that location, the IIS_IUSRS group needs at least Read access to the directory so that it can check for a web.config file in that directory. (ApplicationPoolIdentity is the member of the IIS_IUSRS user group, it does not refer to a user, but a collective name for all program pool default identification users.)

    Right click on the "D:monitor22" folder >> Select "Properties" >> Go to the "Security" tab >> Click "Edit" to adjust the permissions >> Add IIS_IUSRS with at least "Read" and "Execute" permissions.

    If you have manually changed the application pool identity to a specific user account, make sure that account has read permissions to the directory where the web.config file is located.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search