在ASP.NET MVC 3路由参数点字符 [英] Dot character in ASP.NET MVC 3 route parameters

查看:402
本文介绍了在ASP.NET MVC 3路由参数点字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序,只有默认的没有自定义路线。如果我尝试打开本地主机/ MyApp的/控制器/动作/ bla.bla 它工作正常我的机器(Windows 7的32倍,两者卡西尼和IIS)上,但无法在服务器上(2008 R2 x64)的。找到<一href=\"http://stackoverflow.com/questions/3541426/how-to-get-asp-net-mvc-to-match-dot-character-at-the-end-in-a-route\">similar问题但解决的办法是行不通的。此外,发现这篇文章哪里Eilon说,这是MVC特殊字符和它的设计。为什么有我的机器及生产箱,以及如何解决呢?区别

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?

更新:这个问题网站有ExtensionlessUrl-ISAPI-4.0_64bit和ExtensionlessUrl - 集成 - 4.0启用,并映射到*。有没有在web.config中任何托管处理程序。梅德所提到的补丁并不适用于您的计算机,probabaly因为它已经与安装SP1。我可以证实,404将被报告由ASP.NET MVC,不是IIS,因为我可以看到Application_ preSendRequestHeaders请求。此外,如果我附上MvcRouteHandler与超载GetHttpHandler(),它记录所有的RouteData的后裔,它表明,ID是正确映射到bla.bla。任何想法?

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?

推荐答案

所有最新的Windows更新(后SP1)似乎解决这​​个问题。

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

这篇关于在ASP.NET MVC 3路由参数点字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆