[英]Hosting WCF on IIS
我在IIS
上托管WCF Application
服務時IIS
。 該服務正在通過“ 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'.
我的Web.config
<?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>
可能是什么問題?
可能是您在服務器上安裝了多個版本的.NET Framework。 請參閱https://msdn.microsoft.com/zh-CN/library/hh169179(v=nav.90).aspx和https://support.microsoft.com/zh-CN/kb/2015129
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.