佈署到IIS7出現403錯誤

如題執行時出現如下圖
環境:Windows 2008 R2
.Net 4.5
MVC 5.1
clip_image001
解決方法:在組態webServer的module加入runAllManagedModulesForAllRequests="true"
clip_image002
備註:參考其他文章是建議不要用此設定,改成自行加入UrlRoutingModule 如下
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition=""/>..
此設定作完後403不會再出現,但靜態檔案卻都讀不到……………..待續
參考文章
http://rahulgbhatia.wordpress.com/2013/05/28/asp-net-routing-with-iis-7-runallmanagedmodulesforallrequests-true/
http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html












這個網誌中的熱門文章

IIS 設定只允許特定IP進入