ASP.NET WEB API站点访问报404错误

    最近处理一个项目发现一个问题,基于.net 4.5的 WEB API站点访问时始终报404错误,环境是window server 2008 R2 + iis7, 同样的版本代码在很多别的项目没有出现过问题。

后来通过stackoverflow找到解决办法
在站点web.config的<system.webServer><handlers>章节下添加以下配置

 <remove name="UrlRoutingModule-4.0"/> 
 <add name="UrlRoutingModule-4.0" path="*" verb="*" type="System.Web.Routing.UrlRoutingModule" preCondition=""/> 


参考链接:https://stackoverflow.com/questions/15389855/asp-net-web-api-application-gives-404-when-deployed-at-iis-7 
 

posted on 2019-04-25 09:16  omage  阅读(134)  评论(0编辑  收藏  举报