【问题标题】:Could not load type System.Runtime.Diagnostics.ITraceSourceStringProvider无法加载类型 System.Runtime.Diagnostics.ITraceSourceStringProvider
【发布时间】:2014-08-09 02:47:10
【问题描述】:

我刚刚将 Windows Server 2008 R2 就地升级到 Windows Server 2012,现在我的 WCF 自托管服务启动但立即终止并出现以下错误:

服务无法启动。 System.TypeLoadException:无法加载 键入“System.Runtime.Diagnostics.ITraceSourceStringProvider” 程序集'System.ServiceModel.Internals,版本 = 4.0.0.0, 文化=中性,PublicKeyToken=31bf3856ad364e35'。在 System.ServiceModel.Channels.TextMessageEncoderFactory..ctor(MessageVersion 版本,编码 writeEncoding,Int32 maxReadPoolSize,Int32 maxWritePoolSize,XmlDictionaryReaderQuotas 配额)在 System.ServiceModel.Channels.HttpTransportDefaults.GetDefaultMessageEncoderFactory() 在 System.ServiceModel.Channels.HttpChannelListener..ctor(HttpTransportBindingElement bindingElement,BindingContext 上下文)在 System.ServiceModel.Channels.HttpChannelListener`1..ctor(HttpTransportBindingElement bindingElement,BindingContext 上下文)在 System.ServiceModel.Channels.HttpTransportBindingElement.BuildChannelListener[TChannel](BindingContext 上下文)在 System.ServiceModel.Channels.BindingContext.BuildInnerChannelListenerTChannel 在 System.ServiceModel.Channels.MessageEnc...

相同的服务在全新安装的 Windows Server 2012 上运行良好(尽管没有完全修补 atm)。

【问题讨论】:

  • 我会尝试重新安装 .net 4 \ 4.5 。您的服务是否有可能是由 .net 4.0 和 4.5 混合编译的?
  • 它有很多针对 .net 4.0 编译的 nuget 包。服务本身的目标是 4.5.1。

标签: c# .net wcf windows-server-2012


【解决方案1】:

按照 AK_ 的建议重新安装 .NET 4.5.2 解决了该问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-08-14
    • 2015-08-28
    • 2016-03-05
    • 2015-04-16
    • 2010-09-08
    • 2017-04-13
    • 2014-01-03
    • 2013-12-13
    相关资源
    最近更新 更多