HTTP错误500.21 - 内部服务器错误

时间:2014-05-30 09:51:44

标签: asp.net-mvc iis

尝试运行我在IIS中托管的应用程序时,它会给我以下错误。

Module  IIS Web Core
Notification    BeginRequest
Handler Not yet determined
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".
Config File \\?\C:\inetpub\wwwroot\Planner\web.config

谷歌搜索后我发现了一些建议,我试图在命令提示符下运行以下注释它已解锁。

%windir%\ system32 \ inetsrv \ appcmd.exe解锁config -section:system.webServer / handlers -commitpath:apphost

现在我收到以下新错误。

Module  IIS Web Core
Notification    ExecuteRequestHandler
Handler BlockViewHandler
Error Code  0x8007000d
Requested URL   http://localhost:80/Planner/Views
Physical Path   C:\inetpub\wwwroot\Planner\Views
Logon Method    Anonymous
Logon User  Anonymous
Most likely causes:

    Managed handler is used; however, ASP.NET is not installed or is not installed completely.
    There is a typographical error in the configuration for the handler module list.

请帮忙吗?

提前致谢。

1 个答案:

答案 0 :(得分:11)

在使用.Net 4测试我的新网站时,我在Windows 7上遇到了同样的错误。 导致此问题的原因是您的.Net未在IIS中注册。 要解决此错误,我以管理员身份运行CMD并在其中运行此简单命令:

C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ aspnet_regiis.exe -i

用.Net 4注册IIS后,问题解决了。