簡體   English   中英

在IIS上托管WCF

[英]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).aspxhttps://support.microsoft.com/zh-CN/kb/2015129

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM