WCF服务IIS主机错误

时间:2014-06-18 08:54:08

标签: wcf iis-7

我在IIS中有几个网站现在我已在网站>默认网站>下添加了WCF服务。 MyWCFService。

当我尝试通过IIS中的内容视图浏览Service1.svc文件时,我出现了以下错误

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.

这是我的webconfig文件:

<?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>

该服务在我的本地计算机上运行良好,但在IIS中失败,可能与IIS设置有关吗?

我在IIS 7.5.7600版上运行。

提前致谢

编辑1::通过服务器mnager在.net Framework 3.5.1功能下安装的WCF激活(HTTP激活和非HTTP激活)。现在我尝试通过浏览器浏览service1.svc文件时的错误是

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>

输出没有太大变化。

1 个答案:

答案 0 :(得分:1)

  

请求的内容似乎是脚本,静态文件处理程序不会提供。

请勿使用内容视图,请使用浏览器。

另见Script not served by static file handler on IIS7.5