开发者

Dot character in ASP.NET MVC 3 route parameters

I have no custom routes in my application, only the default one. If i try to open localhost/myapp/controller/action/bla.bla it works fine on my machine (Windows 7 x32, both Cassini and IIS) but fails on the server (2008 R2 x64). Found similar question but the solution doesn't work. Also, found this article where Eilon says it's a special character for MVC and it's "by design". Why there is difference between my开发者_如何学运维 machine and the production box and how do i fix it?

Update: the problem site has ExtensionlessUrl-ISAPI-4.0_64bit and ExtensionlessUrl-Integrated-4.0 enabled and mapped to "*.". There are no any managed handlers in web.config. The patch mentioned by Dmitry "is not applicable to your computer", probabaly because it's already installed with SP1. I can confirm that 404 is reported back by ASP.NET MVC, not IIS because i can see the request in Application_PreSendRequestHeaders. Moreover, if i attach a descendant of MvcRouteHandler with overloaded GetHttpHandler() that logs all RouteData it shows that "id" is correctly mapped to "bla.bla". Any ideas?


Is the application using any managed handlers that are mapped to the "*." extension? If so, check out this link:

http://support.microsoft.com/kb/980368


This work for me:

<system.webServer>
<handlers>
  <add name="UrlRoutingHandler"
     type="System.Web.Routing.UrlRoutingHandler, 
           System.Web, Version=4.0.0.0, 
           Culture=neutral, 
           PublicKeyToken=b03f5f7f11d50a3a"
     path="/Users/*"
     verb="GET"/>
</handlers>
</system.webServer>


Can you find what errors(exceptions) if any are you getting by seeing all first chance exceptions. This will show you how can find all the first chance exceptions your application is throwing.


There is an new update available for Win2k8r2sp1, have a look at

http://www.shanmcarthur.net/Default.aspx?DN=7d0cd525-bbc5-46c3-8096-95f93827aeea


Please provide more detail, like what were the expected result, what errors do you get. Which solutions have you tried so far? Have you tried the configuration solution?

<httpRuntime relaxedUrlToFileSystemMapping="true" />

As to, "Why there is a difference between my machine and the production box"... Well my friend, that is a question only you can answer.


All the latest Windows updates (after SP1) seem to solve the issue.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜