1

The API which I'm building is running in IIS express in Visual studio and on a test server which uses the same IIS as the live server. On both the IIS express and the test server works the API just fine, but when we put it on the live server it keeps returning a 404 response.

So far I found this article: Resolve 404 in IIS Express and found an explanation in this article:Request Filtering in IIS 7

All the settings are as far as I know dafault, but what do I need to check for errors more then the verbs?

EDIT: It looks like it has to do with an setting in the web.config. The Managed Pipeline Mode is set to Integrated (classic mode will cause also this problem) and added: <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> source. Now the api is returning a http 500 error, but that is something I've to fix in the code.

  • What IIS components related to ASP have you installed? – Frank Thomas Aug 6 '15 at 14:27
  • We've installed .net 2.0 and 4.0. The Api is currently using .net 4.0 – Quispie Aug 6 '15 at 14:43
  • I'm refering to the IIS World Wide Web Service components in the Windows Features installer (on workstations its in appwiz.cpl -> Turn Windows Features On or Off -> World Wide Web Services). In particular, make sure that Common HTTP Features -> Static Content is checked, In addition to the Application Development Features -> .Net Extensibility, ASP.NET, and both ISAPI features. Also, does .net 4 appear as an option for your Application pools? if not run aspnet_regiis -r (from the visual studio command prompt) to register the script mapping/handlers for .net. – Frank Thomas Aug 6 '15 at 15:05
  • I've installed .net 4.0 indeed with the aspnet_regiis -ir and it is possible to select it from the Application pools. The Static content, .Net extensibility, ASP.NET and both ISAPI Features are installed. – Quispie Aug 7 '15 at 14:49
0

After asking google for ages I've found this site.

At the end of the page I had to set the svc-Integrated-4.0 path to "*" instead of the default "*.svc" this solved the problem for me!

Edit @Scott H Web.config added code:

<configuration>
 <system.webServer>
  <handlers>
   <remove name="svc-Integrated-4.0" />
   <add name="svc-Integrated-4.0" path="*" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
  </handlers>
 </system.webServer>
</configuration>
  • 1
    Link seems broken, can you fill out your answer? – Scott H Apr 11 '18 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.