Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load type System.Runtime.Diagnostics.ITraceSourceStringProvider

I just did an in-place upgrade of Windows Server 2008 R2 to Windows Server 2012 and now my WCF Self-Hosted service starts but terminates immediately with the following error:

Service cannot be started. System.TypeLoadException: Could not load type 'System.Runtime.Diagnostics.ITraceSourceStringProvider' from assembly 'System.ServiceModel.Internals, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. at System.ServiceModel.Channels.TextMessageEncoderFactory..ctor(MessageVersion version, Encoding writeEncoding, Int32 maxReadPoolSize, Int32 maxWritePoolSize, XmlDictionaryReaderQuotas quotas) at System.ServiceModel.Channels.HttpTransportDefaults.GetDefaultMessageEncoderFactory() at System.ServiceModel.Channels.HttpChannelListener..ctor(HttpTransportBindingElement bindingElement, BindingContext context) at System.ServiceModel.Channels.HttpChannelListener`1..ctor(HttpTransportBindingElement bindingElement, BindingContext context) at System.ServiceModel.Channels.HttpTransportBindingElement.BuildChannelListener[TChannel](BindingContext context) at System.ServiceModel.Channels.BindingContext.BuildInnerChannelListenerTChannel at System.ServiceModel.Channels.MessageEnc...

The same service runs fine on a fresh install of Windows Server 2012 (although not fully patched atm).

like image 715
Todd Smith Avatar asked Jun 18 '14 17:06

Todd Smith


1 Answers

A re-install of .NET 4.5.2 as suggested by AK_ fixed the problem.

like image 82
Todd Smith Avatar answered Nov 09 '22 01:11

Todd Smith