简体   繁体   中英

ASP.net MVC deployment to IIS7

I'm trying to deploy a MVC application to a news Server, I have .net framework 4 and ASP.net MVC2 installed. My app pool is assigned to .net 4, integrated mode. But for some reason, the routing is not happening properly. I am getting a 404 error on links and not properly routed to the controller. What am i missing here? Is it might be order of installation of .net framework and IIS?

Your app is probably compiled against .Net Framework Version 2.0. Change your app pool to 2.0 and see if it helps.

So, if you got a 404 error that is because the global.asax is not being executed. Check out if the IIS is configured to "Check if the Directory/File exists", cause the IIS is default configured to check first if the request exists on the server ... MVC doesn't use the 'real' path, per se .

Hope it helps ;)

EDIT Try to log something at the time the routing is working ... I mean when the Route inside the global asax is called and check out if the mapping is called...

Try this :

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
</system.webServer>

Or try to debug routing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM