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'

quilkin
  • 516
  • 7
  • 27
  • Error `500.19` means there is an error in the Web.Config. Are the same things installed on both servers (like the IIS rewrite module, which is not installed by default)? – VDWWD Nov 10 '16 at 11:28
  • As mentioned already, I found (and dealt with) the meaning of 500.19. AFAIK the IIS rewrite module isn't relevant here, but if others suggest it is I will try it. Otherwise I don't wish to complicate my installation. – quilkin Nov 10 '16 at 12:17
  • As you made changes to your applicationhost.config I suspect the problem is there. You mentioned that 2 PCs do the same. Have you ever changed applicationhost.config on another PC? Was IIS installed after VS? – Yuri S Nov 11 '16 at 17:50
  • @Yuri, I didn't change applicationhost.config on my laptop, only the desktop. IIS was installed after VS on both. Should I try to reinstall VS? – quilkin Nov 11 '16 at 20:57
  • I would do reinstall VS if you cannot do aspregiis – Yuri S Nov 11 '16 at 21:20
  • OK, I'll try that. I'm away from home now for a week with limited internet so it'll have to wait. – quilkin Nov 12 '16 at 17:24
  • @Yuri I have repaired VS with no effect. Is aspnet_regiis is relevant here? With Windows10, IIS is installed via Windows Features. Anyway I have edited my post after more experiments. – quilkin Nov 15 '16 at 17:17
  • do you want to get on chat? what time? – Yuri S Nov 15 '16 at 18:12
  • OK, not sure what time zone you're in but between 15:00 and 18:00 GMT Wednesday would be good. – quilkin Nov 15 '16 at 22:49
  • http://chat.stackoverflow.com/rooms/127735/discussion-between-yuri-s-and-quilkin – Yuri S Nov 16 '16 at 15:37

1 Answers1

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

Community
  • 1
  • 1
Yuri S
  • 5,036
  • 1
  • 13
  • 23
  • It was the HTTP Activation that did it in my case. Puzzled why it's not activated by automatically VS2015 for a WCF project. – quilkin Nov 17 '16 at 10:35