Cannot run ASP.net service on IIS (Windows 10) - error 404 (not found)

2

Here's the scenario: Windows 10, VS2015 update 3.

Create new blank 'empty' asp.net project, .NET 4.5.2, and add a dummy 'index.html'. Run project with IIS express (the default): runs fine.

Change server to IIS: get HTTP Error 500.19 - Internal Server Error, Error Code    0x80070021. This suggests an invalid section 'modules' in web.config. So I comment out that section and run again. That gives the 404 error.

My JavaScript is working fine on IIS, but it appears that IIS is not starting the ASP.NET service - every ajax call to the service results in error 404. So I guess there's something missing from web.config. I have this in system.servicemodel

<services>
  <service behaviorConfiguration="ServiceBehavior" name="WebMap.WebMap">
    <endpoint address="" behaviorConfiguration="EndpBehavior" binding="webHttpBinding"
      contract="WebMap.IWebMap" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>

and the file service1.svc consists of

<%@ ServiceHost Language="C#" Debug="true" Service="WebMap.WebMap" CodeBehind="Service1.svc.cs" %>

Notes: (1) two different PC's are doing the same thing. (2) if I create a new 'WebAPI' project, rather than an 'empty' one, I get exactly the same results, except that more sections need commenting out of 'web.config'

asp.net
iis
asked on Stack Overflow Nov 10, 2016 by quilkin • edited Nov 15, 2016 by quilkin

1 Answer

6

In addition to what is answred here IIS - this configuration section cannot be used at this path (configuration locking?) also add HTTP activation as shown below

enter image description here

answered on Stack Overflow Nov 16, 2016 by Yuri S • edited May 23, 2017 by Community

User contributions licensed under CC BY-SA 3.0