我有一个简单的webAPI构建Visual Studio 2013。当我从VS13运行它时,它工作得很好,但当我在本地IIS中复制项目时,它给了我以下错误。

HTTP错误500.19 -内部服务器错误不能被请求的页面 访问,因为该页的相关配置数据为 无效的。

详细错误信息:

模块IIS Web核心

通知BeginRequest

处理人尚未确定

错误码0x80070021

配置错误该配置项不能在该路径下使用。当section被锁定在父级时,就会发生这种情况。锁定是默认的(overrideModeDefault="Deny"),或者由overrideMode="Deny"或遗留的allowOverride="false"的位置标记显式设置。

配置文件\?\C:\inetpub\wwwroot\APITeslin\web.config

配置来源:

36:   <system.webServer>  
37:     <handlers>  
38:       <remove name="ExtensionlessUrlHandler-Integrated-4.0" />

当前回答

得到了完全相同的错误,然后得到了这个问题。正如@SpaceBison在评论中提到的,这个答案描述了解决方案- https://stackoverflow.com/a/12867753/404099。我发现得太晚了,它漏了几步。这对我来说很管用:

Windows Server 2012, IIS 8.5。应该也适用于其他版本。

Go to server manager, click add roles and features In the roles section choose: Web Server Under Security sub-section choose everything (I excluded digest, IP restrictions and URL authorization as we don't use them) Under Application Development choose .NET Extensibility 4.5, ASP.NET 4.5 and both ISAPI entries In the features section choose: NET 3.5, .NET 4.5, ASP.NET 4.5 In the web server section choose: Web Server (all), Management Tools (IIS Management Console and Management Service), Windows Authentication - if you are using any of it

其他回答

请将<staticContent />行从web.config中删除。

在Windows 8.1和iis8.5上,我的解决方案是从控制面板注册4.5:

程序和功能>打开或关闭Windows功能>信息信息服务>万维网服务>应用程序开发功能>选择ASP。NET 4.5

单击OK。

今天在Windows 2016核心服务器上,我通过确保GIOESCOM提到的组件安装来解决这个问题,然后我修复了我的情况下的SDK,用于. net Core 3.1, . net 5和. net 6,解决了这个问题。NET 4.7.2 MVC web应用程序工作。

我通过以下方法解决了这个问题:

WebServer(ISS)->WebServer->Application Development
add .NET Extensibility 3.5
add .NET Extensibility 4.5
add ASP.NET 4.5
add ISAPI Extensions
add ISAPI Filters

这很有效,还节省了我的时间。HTTP错误500.19 -内部服务器错误0x80070021 (IIS 8.5)