0
votes

i have a couple of web site in IIS now i have added a WCF service under sites>default website > MyWCFService.

When i tried to browse the Service1.svc file through content view in IIS i was presented below error

HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler. 

Detailed Error Information
Module:  StaticFileModule 
Notification : ExecuteRequestHandler 
Handler : StaticFile 
Error Code 0x80070032 
Requested URL :  https://localhost:443/MyWCFService/Service1.svc
Physical Path : D:\Inetpub\wwwroot\MyWCFService\Service1.svc 
Logon Method : Negotiate 
Logon User : XXXXXXXXXXXXXX

 Most likely causes:
•The request matched a wildcard mime map. The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different handler.

 Things you can try:
•If you want to serve this content as a static file, add an explicit MIME map.

Here is my webconfig file:

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="MyService.Service1" behaviorConfiguration="MyService.Service1Behavior">
        <endpoint address="Service1" binding="basicHttpBinding" contract="MyService.IService1"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MyService.Service1Behavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="webBehaviour">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

The service runs fine in my local machine, but it fails in IIS, may be something to do with IIS Settings?

I'm running on IIS version 7.5.7600.

Thanks in advance

Edit 1: : Installed WCF Activation (HTTP Activation and Non-HTTP Activation) under .net Framework 3.5.1 features in via Server mnager. Now the error when i tried browing the service1.svc file through browser is

Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. 

i have added this entry in web.config file as well
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<add assembly="System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</assemblies>
</compilation>

No great change in output.

1

1 Answers

1
votes

The requested content appears to be script and will not be served by the static file handler.

Don't use Content View, use a browser.

See also Script not served by static file handler on IIS7.5.