Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

404 on MVC / webform app when accessing a service

I integrated MVC3 into my webforms app using Scott Hanselmans article: http://www.hanselman.com/blog/IntegratingASPNETMVC3IntoExistingUpgradedASPNET4WebFormsApplications.aspx

All ways good and seemed to work fine when running locally on my pc. However when this has been deployed to testing the following URL breaks the app giving me a 404: http://testserver/portal/Services/SEBService.asmx/SEBSearch

if I put in just: http://testserver/portal/Services/SEBService.asmx it sees the service

scratching my head I tried the following fix in global.asax:

public static void RegisterRoutes(RouteCollection routes)
{
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        routes.IgnoreRoute("{resource}.asmx/{*pathInfo}");
}

Alas still broken :( Any thoughts, fixes, recommendations would be greatly appreciated

like image 881
Andy Stannard Avatar asked Dec 03 '22 05:12

Andy Stannard


1 Answers

fixed with this:

routes.Ignore("{*allasmx}", new { allasmx = @".*\.asmx(/.*)?" });

very odd how it worked on some machines and not others but with the above included it works on all machines.

like image 77
Andy Stannard Avatar answered Dec 23 '22 06:12

Andy Stannard