404 in MVC / webform application when accessing a service

I have included MVC3 in my webforms application using an article by Scott Hanselman: http://www.hanselman.com/blog/IntegratingASPNETMVC3IntoExistingUpgradedASPNET4WebFormsApplications.aspx

All the methods are good and seemed to work perfectly when working on my computer. However, when it was deployed to test the following URLs, the application adds me 404: http: //testserver/portal/Services/SEBService.asmx/SEBSearch

if I put only: http: //testserver/portal/Services/SEBService.asmx he 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, it’s still broken :( Any thoughts, corrections, recommendations will be very appreciated

+4
source share
2 answers

fixed with this:

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

it is very strange how he worked on some machines, and not on others, but with the above turned on he works on all machines.

+14
source

I had to update my web.config as follows.

 <system.webServer> <handlers> <remove name="asmx" /> <add name="asmx" verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </handlers> </system.webServer> 
+2
source

Source: https://habr.com/ru/post/1398606/


All Articles