无法加载文件或程序集'Microsoft.WindowsAzure.ServiceRuntime,Version = 2.0.0.0

时间:2013-05-31 18:05:38

标签: azure tfsbuild azure-sdk-.net

我们正在使用Azure SDK 1.8,它在本地工作正常。我们正在使用TFS托管的构建控制器在azure上进行部署。

之前工作正常,但今天突然我们收到此错误,虽然我们没有更改azure sdk dll版本但在线我们收到此错误。这是因为TFS构建控制器升级了新的sdk吗?奇怪的是,这个版本每次都显示成功。

在TFS构建服务中,我发现了这个奇怪的东西,为什么它引用了v2.0 sdk。 enter image description here

Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

5 个答案:

答案 0 :(得分:20)

如果其他所有方法都失败了,并且在bin中部署了正确的DLL,请尝试在web.config中添加程序集绑定重定向:

<dependentAssembly>
  <assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31bf3856ad364e35" />
  <bindingRedirect oldVersion="2.0.0.0" newVersion="1.8.0.0" />
</dependentAssembly>

根据需要更改绑定版本号。

答案 1 :(得分:7)

这发生在我身上,因为我将引用从2.0更新到2.2但我仍然在我的网络配置中引用了版本2.0 dll:

<system.diagnostics>
<trace autoflush="true">
  <listeners>
    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
      <filter type="" />
    </add>
  </listeners>
</trace>

答案 2 :(得分:3)

当我升级到2.3.0.0时发生了这种情况。

要修复它我进入了参考 - &gt;右键单击dll - &gt;点击属性 - &gt;将copy local设置为true。

答案 3 :(得分:1)

我相信我遇到了与你完全相同的问题(如果我没记错的话)。 1.8 SDK包含对旧StorageClient dll的引用。尝试在项目中添加引用:

Microsoft.WindowsAzure.StorageClient version 1.7.0.0 

请告诉我这是否有帮助!

答案 4 :(得分:-1)

我最近也遇到过这个问题。 根据我的研究,这可能是由多种原因造成的。 解决此问题的最佳方法是首先进行诊断。要获得更好的诊断,请从“例外”窗口启用所有CLR例外。现在,您的Visual Studio将破坏任何抛出的异常。从这里你应该能够看到异常的内部细节。

相关问题