joh*_*ith 3 c# asp.net iis asp.net-web-api
我构建了一个基本的RESTful Web服务,以便可以接收事件。我可以在本地IIS上很好地运行,但是在服务器上的IIS 10中发布它时出现以下错误
HTTP错误500.21-内部服务器错误处理程序“ ExtensionlessUrlHandler-Integrated-4.0”具有错误的模块“ ManagedPipelineHandler”
我在应用程序功能中将应用程序池的托管管道模式设置为集成并启用目录浏览。我的网络配置如下所示:
<system.webServer>
<modules>
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
Run Code Online (Sandbox Code Playgroud)
如果我将应用程序池的托管管道模式更改为“经典”,则实际上可以看到根站点,但是尝试浏览或调用API会得到404(例如xx.x.xxx.x / api / Controller / Action)。
小智 6
使用IIS 10和.NET 4.6
这些解决了问题。
| 归档时间: |
|
| 查看次数: |
5875 次 |
| 最近记录: |