4
votes

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?

1
Update: The host has solved my problem with no need of any change in my web.config or libraries. I'm asking them how they did it but no answer, yet! - Babak
How did you solve that problem, can you please share it ? Thanks in advance. - Kamrul Hasan
I have a shared host and they don't tell me how did they fix it. It should be some server configuration or misconfiguration. Sorry, That I cannot help no more :( - Babak
I am facing the same Issue, and not sure how to solve this. - sham
Next time try checking if there is ISAPi module intalled: Web server > modules If there is no such records, you can install it via Server management tool: Role-based installation - Andrey Zaytsev

1 Answers

0
votes

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";