首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法加载文件或程序集“”Microsoft.WindowsAzure.Diagnostics“”或其依赖项之一

无法加载文件或程序集“”Microsoft.WindowsAzure.Diagnostics“”或其依赖项之一
EN

Stack Overflow用户
提问于 2012-10-08 05:06:56
回答 5查看 17.2K关注 0票数 11

我的系统在几天前崩溃了,因为当我尝试调试本地Azure环境时,我得到了这个错误‘无法加载文件或程序集'Microsoft.WindowsAzure.Diagnostics’或它的依赖项之一‘。

我已经重新安装了以下软件(Windows Azure tools for MS VS 2012年6月sp1,Windows Azure模拟器- 2012年6月,Windows Azure Librarires for .net - 2012年6月)。

仍然有相同的问题,任何建议。

代码语言:javascript
运行
复制
=== Pre-bind state information ===
LOG: User = ...........
LOG: DisplayName = Microsoft.WindowsAzure.Diagnostics
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Microsoft.WindowsAzure.Diagnostics | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Projects/Client/Connection Intelegence/CICloud/CIWebRole/
LOG: Initial PrivatePath = C:\Projects\Client\Connection Intelegence\CICloud\CIWebRole\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Projects\Client\Connection         Intelegence\CICloud\CIWebRole\web.config
LOG: Using host configuration file: C:\Program Files\IIS Express\config\templates\PersonalWebServer\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/9cc4e65f/1fb72ae3/Microsoft.WindowsAzure.Diagnostics.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/9cc4e65f/1fb72ae3/Microsoft.WindowsAzure.Diagnostics/Microsoft.WindowsAzure.Diagnostics.DLL.
LOG: Attempting download of new URL file:///C:/Projects/Client/Connection Intelegence/CICloud/CIWebRole/bin/Microsoft.WindowsAzure.Diagnostics.DLL.
LOG: Using application configuration file: C:\Projects\Client\Connection Intelegence\CICloud\CIWebRole\web.config
LOG: Using host configuration file: C:\Program Files\IIS Express\config\templates\PersonalWebServer\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35



[FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Diagnostics' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))]
[FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +210
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +242
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +17
System.Reflection.Assembly.Load(String assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +122
[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +12761078
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +503
System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +142
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +203
System.Web.Compilation.BuildManager.ExecutePreAppStart() +152
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1151

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722601
EN

回答 5

Stack Overflow用户

发布于 2012-10-08 20:06:21

看起来这是在你的应用程序启动时发生的。看看您的web.config,是否有指向Microsoft.WindowsAzure.Diagnostics程序集的跟踪侦听器?这可能是您的应用程序无法工作的原因。

首先,看一下您的程序集引用,如果Microsoft.WindowsAzure.Diagnostics存在,则将其删除(只是为了确保我们不会使用旧版本)。然后,添加对Microsoft.WindowsAzure.Diagnostics,的引用,但确保这是版本1.7.0.0。

您可以在以下位置找到此程序集的正确版本:Microsoft:\Program Files\Microsoft \ Azure.NET SDK\2012-06\ref

票数 8
EN

Stack Overflow用户

发布于 2015-10-26 22:21:00

我知道这是一个古老的话题,但它仍然是谷歌“无法加载文件或程序集Microsoft.WindowsAzure.Diagnostics”的最高搜索结果,所以我这样做了:

这发生在我的Azure SDK 2.7.1和Visual Studio 2013上。在升级到Windows 10和Azure SDK 2.7之间的某个地方,有些东西没有正确安装。我尝试重新安装Azure SDK,升级到Visual Studio 2015,但都没有成功。最后,我不得不在我的app.config中更改以下代码行:

代码语言:javascript
运行
复制
    <system.diagnostics>
    <trace>
        <listeners>
            <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
                <filter type="" />
            </add>
        </listeners>
    </trace>
</system.diagnostics>

代码语言:javascript
运行
复制
    <system.diagnostics>
    <trace>
        <listeners>
            <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
                <filter type="" />
            </add>
        </listeners>
    </trace>
</system.diagnostics>

请注意从"2.7.0.0“到"2.5.0.0”的更改。对我来说,Microsoft.WindowsAzure.Diagnostics 2.7.0.0dll并不存在。恢复到2.5.0.0可以正常工作。我仍然想找出根本原因,但我还有更重要的事情要做。希望这能有所帮助!

票数 5
EN

Stack Overflow用户

发布于 2013-08-13 00:17:50

除了Sandrinio的回答(对不起,我没有权限),我还遇到了一个类似的错误,其中引用了1.7.0.0,但我的web.config中的这一节指向版本1.0.0.0

代码语言:javascript
运行
复制
<system.diagnostics>
<trace>
  <listeners>
    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
      name="AzureDiagnostics">
      <filter type="" />
    </add>
  </listeners>
</trace>

我把它注释掉了,问题就解决了。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12772858

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档