0

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.

Ramu
  • 343
  • 1
  • 6
  • 21

1 Answers1

1

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.

Community
  • 1
  • 1
CodeCaster
  • 147,647
  • 23
  • 218
  • 272
  • Tried to open url in Broswer. No joy mate. 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed. – Ramu Jun 18 '14 at 10:21
  • 1
    http://stackoverflow.com/questions/5385714/deploying-website-500-internal-server-error – CodeCaster Jun 18 '14 at 10:22
  • That URL didnt help me much in solving the issue mate. As said earlier i have couple of other web sites under IIS ands they are working fine. So it may not be the prolem with Enabling Static File handler content stuff – Ramu Jun 19 '14 at 13:31
  • @Ramu "didn't help me much" doesn't help me much, buddy. You need to provide more information so we can help you analyze this issue. With repeating "it doesn't work" we can't do much. What was the underlying error for the 500 Internal Server Error you received? – CodeCaster Jun 19 '14 at 14:09
  • Apologies mate,its not my intent to provide a abstract answer. I've tried to create the procedure from begining again,created virtual directory and tried to browse it from server itself first. it says "Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https ] ". when i tried to broswer from a client browser it says "404 - File or directory not found." some thing like i'm browsing wrong directory. My IIS uses https by default(SSL Installed).could this be reason?thankyou – Ramu Jun 20 '14 at 08:15
  • 1
    Thanks mate, below steps solved issue. 1. Enabled options for WCF in IIS (which by default are not checked) 2. Executed aspnet_regiis /iru 3.Removed dll references from web.config 4.Finally, i was deploying my web site under HTTPS so i created a new web site under sites in IIS with only HTTP binding. Hope this might help someone if needed. – Ramu Jun 23 '14 at 07:47