Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
955 views
in Technique[技术] by (71.8m points)

visual studio 2013 - How to solve Windows Azure Diagnostic Runtime Error (Could not create WindowsAzure.Diagnostics, Version=xx, Culture=neutral, PublicKeyToken=xx

privateLibManager libManager;
private LibManager Connect()
{
   this.libManager=new LibManager();//here we are getting an error
}

Error:

The type initializer for 'SWConfigDataClientLib.LibManager' threw an exception

Inner Exception:

Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics,Version=2.2.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35.

Source

IpPbxCDSClientLib

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

First make sure you have added references to Microsoft.WindowsAzure.Diagnostics from the SDK folders (typically c:Program FilesMicrosoft SDKsWindows Azure.NET SDKv2.2 efMicrosoft.WindowsAzure.Diagnostics.dll)

Next, if you are not running your project in the emulator (i.e. the cloud project set as the startup project), then set the trace filter level to TraceEventType.Error or TraceEventType.None to avoid trying to write verbose Azure messages to the trace listener. In you web or app config:

  <system.diagnostics>
    <trace>
      <listeners>
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
          <filter level="TraceEventType.Error" />
        </add>
      </listeners>
    </trace>
  </system.diagnostics>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...