ASP.NET MVC on IIS 7.5

前端 未结 28 1983
北荒
北荒 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:10

    Make sure you have is the following set in your web.config:

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer>
    

    Better solution:

    Even though above solution works absolutely fine, it can cause other problem as it runs all your registered HTTP modules on every request (even on every request of .jpg .gif .css .html .pdf etc) and it is obviously waste of resource. Instead

    <system.webServer>
    <modules>
      <remove name="UrlRoutingModule-4.0"/>
      <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" preCondition="" />
    </modules>
    </system.webServer>
    

    Make sure preCondition attribute is empty means it will run on all requests. [Read more](http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html,"Read original post")

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

    Another possible solution, if you move around your global.asax, make sure the markup points to the correct MvcApplication class. Hopefully this will save someone in future.

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

    I have met the same 404.14 problem suddenly. Finally the problem had been fixed by unchecking "precompile while publishing" in the publish profile settings.

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

    One more thing to make sure you have is the following set in your web.config:

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer>
    
    0 讨论(0)
  • 2020-11-22 12:12

    You can solve this error by running cmd as admin than enter image description here

    Do the same as in picture for windows 32 bit

    Just make changes in 64 bit as framework64 instead of framework only Than go to iis and refresh the site
    If u still got some error make changes in application pool

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

    Adding another solution for this issue.

    in my Global.asax.cs file I had disabled attempted php files from being consumed by the MVC pipeline using the following:

    routes.IgnoreRoute( "{*php}" );

    I had done these previously in a MVC2 project and it worked fine, but doing this in my MVC 3 app caused the issue reported above.

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