小编Leo*_*lev的帖子

在RoleEnvironment初始化程序中导致ModuleLoadException的原因是什么?

我正在使用WCF服务调试类库,该服务使用WCF测试客户端和Visual Studio 2013 Ultimate调试器在Windows 8.1上使用已安装的Azure SDK 2.4.该库是使用AnyCPU编译的.RoleEnvironment.IsAvailable调用时会发生异常.以下是详细信息:

  Message=The type initializer for 'Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment'   threw an exception.
  ...
  InnerException: System.TypeInitializationException
       Message=The type initializer for '<Module>' threw an exception.
       Source=Microsoft.WindowsAzure.ServiceRuntime
       TypeName=<Module>
       StackTrace:
            at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeEnvironment()
            at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment..cctor()
       InnerException: <CrtImplementationDetails>.ModuleLoadException
            HResult=-2146233088
            Message=The C++ module failed to load while attempting to initialize the default appdomain.
            Source=msshrtmi
            StackTrace:
                 at <CrtImplementationDetails>.ThrowModuleLoadException(String errorMessage, Exception innerException)
                 at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
                 at .cctor()
            InnerException: System.Runtime.InteropServices.COMException
                 HResult=-2146234334
                 Message=Invalid operation. (Exception from HRESULT: 0x80131022)
                 Source=mscorlib
                 ErrorCode=-2146234334
                 StackTrace:
                      at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) …
Run Code Online (Sandbox Code Playgroud)

c# wcf azure-sdk-.net visual-studio-2013 windows-8.1

4
推荐指数
1
解决办法
2551
查看次数