Web Api 在本地开发环境中访问:http://localhost:65434/api/xxx 正常,但是部署到IIS上确访问不了。
查询原因,需要在Web.config中配置:
<system.webServer>
<vaildation vaildateIntegrateModeConfiguration="false" />
<modules runAllManagerModulesForAllRequest="true" />
.....
<add name="ExtensionlessHandler-Integrated-4.0" path="*" verb="*" ... />
</system.webServer>
<system.webServer>
<vaildation vaildateIntegrateModeConfiguration="false" />
<modules runAllManagerModulesForAllRequest="true" />
.....
<add name="ExtensionlessHandler-Integrated-4.0" path="*" verb="*" .../>
</system.webServer>

本文介绍了解决WebAPI在部署到IIS后无法访问的问题,通过在Web.config文件中正确配置system.webServer节点下的validation、modules及ExtensionlessHandler-Integrated-4.0等元素来实现。
5369

被折叠的 条评论
为什么被折叠?



