本文介绍了如何解决Windows Azure诊断运行时错误(无法创建WindowsAzure.Diagnostics,Version = xx,Culture = neutral,PublicKeyToken = xx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

错误:

'SWConfigDataClientLib的类型初始值设定项。 LibManager引发了异常

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

内部异常:

无法创建Microsoft。 WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,Microsoft.WindowsAzure.Diagnostics,版本= 2.2.0.0,文化=中性,
PublicKeyToken = 31bf3856ad364e35。

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

来源

IpPbxCDSClientLib

IpPbxCDSClientLib

推荐答案

首先请确保已添加从SDK文件夹中引用 Microsoft.WindowsAzure.Diagnostics (通常是c:\Program Files\Microsoft SDKsWindows Azure.NET SDK\v2.2\ ref\Microsoft.WindowsAzure.Diagnostics.dll)

First make sure you have added references to Microsoft.WindowsAzure.Diagnostics from the SDK folders (typically c:\Program Files\Microsoft SDKs\Windows Azure.NET SDK\v2.2\ref\Microsoft.WindowsAzure.Diagnostics.dll)

下一步,如果您不在仿真器中运行项目(例如,云项目s等作为启动项目),然后将跟踪过滤器级别设置为 TraceEventType.Error TraceEventType.None 以避免尝试将详细的Azure消息写入跟踪侦听器。在您的网络或应用程序配置中:

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>

这篇关于如何解决Windows Azure诊断运行时错误(无法创建WindowsAzure.Diagnostics,Version = xx,Culture = neutral,PublicKeyToken = xx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 20:34