【发布时间】:2016-06-06 10:25:00
【问题描述】:
我在IIS 上托管WCF Application 服务时遇到问题。该服务正在与Add Service Reference 的其他项目一起在解决方案中工作,但是当我想在IIS 上托管它时,当我从IIS 打开Service.svc 时出现错误。
Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
我的网站配置
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name ="svcbh">
<serviceMetadata httpGetEnabled="False"/>
<serviceDebug includeExceptionDetailInFaults="False"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="WCFApplication.Service1" behaviorConfiguration="svcbh">
<host>
<baseAddresses>
<add baseAddress="http://localhost:9000/Service1/"/>
</baseAddresses>
</host>
<endpoint name="duplexendpoint"
address=""
binding="wsDualHttpBinding"
contract="WCFApplication.IService1"/>
<endpoint name="MetaDataTcpEndpoint"
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
可能是什么问题?
【问题讨论】:
-
您是否在服务器上激活了 WCF 功能?
-
您是否也检查了 HTTP 激活?见this answer