IIS7 MVC路由不起作用 [英] IIS7 MVC Routing Not Working

查看:308
本文介绍了IIS7 MVC路由不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们公司发布了基于MVC的产品(目标v4.5),该产品已停止在客户站点上处理似乎是环境问题的产品-以前没有任何问题的版本现在给出了 403.14-Web服务器配置为不列出此目录的内容



认为正在发生...




  • 用户访问

    解决方案

    您是否已检查用户应用程序池proc ESS正在运行?我认为您的网站需要具有运行.net库的权限才能运行,而且我似乎无缘无故地看到了这一变化(可能与系统的过度更新有关。)




    Our company ships an MVC based product (targeting v4.5) which has stopped working on a customer site for what appear to be environmental issues - a build which worked with no problems once upon a time now gives a 403.14 - The Web server is configured to not list the contents of this directory. .

    What I think is happening...

    • The user accesses http://server/AppName
    • Because it's an MVC app, the default route (Reports/Index) should be used.
    • Instead IIS is looking for a default document...
    • ... and, not finding one, it assumes the user wants to list the contents of the directory...
    • ...which is not enabled so it throws a 403.14. .

    What I've tried so far...

    • Accessing the route directly.. results in 404 error. So I'm pretty sure IIS doesn't realise it should use routing.
    • Use aspnet_regiis to register ASP.Net with IIS. This was done from the Framework64 folder since...
      • OS is 64 bit - Windows Server 2008 (Standard without Hyper-V)
      • IIS is 64 bit - though Enable 32-Bit Applications is true
    • Checked AppPool is targeting v4 of the framework - it is.
    • Changed AppPool mode to Classic - was pretty sure it should be integrated but was worth ruling it out. It is now back to Integrated
    • Confirmed RunAllManagedModulesForAllRequests is set to true in the web.config.
    • Checked permission conditions defined in <system.webServer> section of web.config are met - they are.
    • Created the simplest of MVC applications and deployed it - same problem.
    • Running the command shell as Administrator unregistered ASP.Net using aspnet_regiis -ua and re-registered using aspnet_regiis -enable -i. We hit a couple of permission problems - and the Temporary ASP.NET Files directory was missing but once they were address we were back to the same error.
    • Added a simple default.htm - when present, this is served in response to the http://server/AppName request.

    I'm clean out of ideas and all google hits suggest some combination of the above - or enabling directory browsing (which I think is just a symptom rather than the root cause).

    Also, not sure if it's relevant but the amount of configurable elements available for the application in IIS seems a bit below what I would have expected...

    解决方案

    Have you Checked the user the application pool process is running under? I think Your site needs to run with permissions to execute the .net libraries and I've seen this just change for seemingly no reason (probably related to an overzealous update to the system).

    这篇关于IIS7 MVC路由不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆