【发布时间】:2014-06-18 08:54:08
【问题描述】:
我在 IIS 中有几个网站,现在我在站点>默认网站> MyWCFService 下添加了一个 WCF 服务。
当我尝试通过 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::通过 Server 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>
输出没有太大变化。
【问题讨论】: