And*_*ard 4 c# routing web-services asp.net-mvc-3
我使用Scott Hanselmans文章将MVC3集成到我的webforms应用程序中:http: //www.hanselman.com/blog/IntegratingASPNETMVC3IntoExistingUpgradedASPNET4WebFormsApplications.aspx
在我的电脑上本地运行时,一切都很好,似乎工作正常.但是,当部署到测试以下URL时,应用程序会给我一个404: http://testserver/portal/Services/SEBService.asmx/SEBSearch
如果我只是输入: http://testserver/portal/Services/SEBService.asmx它看到了服务
抓我的头我在global.asax中尝试了以下修复:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.asmx/{*pathInfo}");
}
Run Code Online (Sandbox Code Playgroud)
唉仍然破碎:(任何想法,修复,建议将不胜感激
And*_*ard 14
固定的:
routes.Ignore("{*allasmx}", new { allasmx = @".*\.asmx(/.*)?" });
Run Code Online (Sandbox Code Playgroud)
非常奇怪它是如何在某些机器上运行而不是其他机器但是上面包括它适用于所有机器.