开发者

ASP.NET routes not working in IIS6

开发者 https://www.devze.com 2023-03-23 08:26 出处:网络
I have built a small web application in asp开发者_JAVA百科.net c# in VS 2010 using Framework 3.5.

I have built a small web application in asp开发者_JAVA百科.net c# in VS 2010 using Framework 3.5. I need to deploy it on Windows 2003 server with IIS6.

Its using routes ( System.Web.Routing ) which are working fine when I run though Visual Studio. But now after deploying to IIS6 server, it gives 404 error. If I type exact path of page, it works fine.

like http://localhost.local/forms/user/login.aspx works but my custom route http://localhost.local/user/login gives 404 error

I have goggled found this Installing Wildcard Application Mappings & Running ASP.NET MVC Under IIS 6.0 and IIS 7.0 Classic Mode : Solution to Routing Problem

Any clue how to fix this?


In IIS, .net runs as an IIS extension. This means there has to be something about the request that IIS can recognise to know it needs to send the request to .Net. This is usually in the form of a file extension, i.e. .aspx

so the path http://localhost/forms/user/login.aspx works because of the .aspx extension

the path http://localhost/user/login won't in itself be passed to .NET to execute, unless the path exists and there is a default.aspx in the folder.

IIS7 solves this by elevating .net to an integral part - integrated pipeline.

You might get it to work using wildcard mapping or by using an extension that maps to .net - which is what is recommended for MVC on IIS 6


I have goggled found this http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5c5ae5e0-f4f9-44b0-a743-f4c3a5ff68ec.mspx?mfr=true & http://www.tugberkugurlu.com/archive/running-asp-net-mvc-under-iis-6-0-and-iis-7-0-classic-mode---solution-to-routing-problem but Its still not working.

Got the problem, I was not restarting the IIS6 properly. I was only restarting the website. Above links were showing correct info how to fix this.

0

精彩评论

暂无评论...
验证码 换一张
取 消