ASP.NET Core web API : 0x80070021

Holysmokes-6260 41 Reputation points
2023-05-15T13:00:24.98+00:00

web.config.txtHi,

I am struggling to visualize a detail error of my asp.net core web api application (NET 6) as nothing is logged.

In IIS i receive the following error

IIS 10.0 Detailed Error - 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid

Error Code 0x80070021

Config Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

Could someone shed some light on this issue? I attach my web.config





Thanks,

Holy

Windows development Internet Information Services
Developer technologies ASP.NET ASP.NET Core
{count} votes

Accepted answer
  1. Sam Wu-MSFT 7,561 Reputation points Microsoft External Staff
    2023-05-16T03:24:59.0133333+00:00

    @Holysmokes-6260

    This problem can occur if the specified portion of the IIS configuration file is locked at a higher configuration level.

    Try to unlock the specified section, or don't use it at the higher level. For more information about configuration locking, see How to Use Locking in IIS 7.0 Configuration.

    Another way is checking your windows features.

    1. Click "Start button"
    2. in the search box, enter "Turn windows features on or off"
    3. in the features window, Click: "Internet Information Services"
    4. Click: "World Wide Web Services"
    5. Click: "Application Development Features"
    6. Check (enable) the features. I checked all but CGI.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.