MVC5 routing error (404.0) error on IIS 7.5

3

An old story of everything works fine on the development machine but not on the host server.

enter image description here

HTTP Error 404.0 - Not Found

  • Module IIS Web Core
  • Notification MapRequestHandler
  • Handler StaticFile
  • Error Code 0x80070002

Trying to produce the same error on the development machine by adding <remove name="UrlRoutingModule-4.0" /> to system.webServer - modules and resolving it when adding <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />, but that not works on the host. I've also try <modules runAllManagedModulesForAllRequests="true" /> but nothing changed.

And here is the handlers part:

<handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <remove name="OPTIONSVerbHandler" />
      <remove name="TRACEVerbHandler" />
      <remove name="WebDAV" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
      <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>

Few more information:

  • MVC.Net 5.2.2.0
  • IIS 7.5 on Windows 2008
  • Integrated .Net 4.0 application pool.

Is there anything else that I should do?

Now, having the same problem in IIS8, any idea?

asp.net-mvc
iis
iis-7.5
iis-8
asp.net-mvc-5.2
asked on Stack Overflow Dec 4, 2014 by Babak • edited Dec 7, 2014 by Babak

1 Answer

0

I had similar problem. It turns out to be discrepancy with Virtual folder name and the URL I was constructing to call Web API route:

var URLGetUserAccesses = "/api/Login/GetUserAccesses";

Vs.

var URLGetUserAccesses = "../api/Login/GetUserAccesses";
answered on Stack Overflow Nov 28, 2017 by SubodhW • edited Nov 28, 2017 by J P

User contributions licensed under CC BY-SA 3.0