ASP.NET MVC on IIS 7.5

前端 未结 28 1984
北荒
北荒 2020-11-22 11:33

I\'m running Windows 7 Ultimate (64 bit) using Visual Studio 2010 RC. I recently decided to have VS run/debug my apps on IIS rather than the dev server that comes with it. <

相关标签:
28条回答
  • 2020-11-22 12:25

    As strange as it may seem, reinstalling IIS was what has worked for me, with the following command run from inside the .net version folder:

    aspnet_regiis.exe /i
    

    enter image description here

    When I first run this command, I begun getting the HTTP Error 403.14. But once I runned the command again it solved the problem.

    Obs: Another thing I also did was to remove HTTP Redirect from the server features in Server Management screen before reiinstalling IIS. Maybe this also had an impact in solving the problem, but I am not sure. So, if reinstalling IIS still doesn't work, please try removing HTTP Redirect and try again. Hopefully it may work for you too.

    0 讨论(0)
  • 2020-11-22 12:25

    Yet another reason this can happen - your RouteConfig.cs or WebApiConfig.cs are invalid.

    In my case, I had a route defined as such (note the parenthesis instead of curly brace):

    ...
    routeTemplate: "api/(something}"
    ...
    
    0 讨论(0)
  • 2020-11-22 12:25

    In my case .NET CRL Version in Application pool prppertires was set to No managed code (do not know why). Setting it to .NET CRL Version v4.0.30319 solved the problem.

    0 讨论(0)
  • 2020-11-22 12:27

    Another reason why someone might get this error is if the file Global.asax is not in the root folder anymore.

    0 讨论(0)
  • 2020-11-22 12:27

    I was also receiving this error and discovered that "HTTP Redirection" was not turned on in Windows Server. This blog post points this out as well: http://blogs.msdn.com/b/rjacobs/archive/2010/06/30/system-web-routing-routetable-not-working-with-iis.aspx

    0 讨论(0)
  • 2020-11-22 12:28

    I altered my default route at one point from:

    routes.MapRoute(
    "Default",
        "{controller}/{action}/{id}",
        new { controller = "Home", action = "Index", id = UrlParameter.Optional }
    

    To:

    routes.MapRoute(
    "Default",
        "{controller}/{action}/{id}",
        new { controller = "Home", action = "Index" }
    

    Which gave me your error. Glad someone mentioned routing because I probably would've been on this forever.

    0 讨论(0)
提交回复
热议问题