繁体   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