Asp. netmvc5
Environment: VS2013 + MVC5 + IIS EXPRESS
Problem: If you migrate from Asp.net Web to MVC, you may encounter a needMake the original link (such as http: // localhost: 12345/old/library.html) accessible, and locate the original link to the new ActionBy default, MVC does not route the html suffix and directly gives you a 404 error (not found)
Solution: add in web. config
<System. webServer>
<Modules runAllManagedModulesForAllRequests = "true"/>
</System. webServer>
Best:
Thanks for the cloudification solution:
We do not recommend that you set runAllManagedModulesForAllRequests = "true"
This will increase the traffic request.
Set this way
<Handlers>
<Add name = "html_PageHandlerFactory" path = "*. html "verb =" * "type =" System. web. UI. pageHandlerFactory "resourceType =" Unspecified "preCondition =" integratedMode "/>
</Handlers> This is really useful! When I use <modules runAllManagedModulesForAllRequests = "true"/>, I find that the custom route inherited from RouteBase will be executed once more. Why, this should be the added traffic request!