运行我的.NET项目时,出现以下运行时错误:
据我所了解,
我的.NET项目引用了Azure SDK 2.5中的ServiceRuntime 2.5.0.0。异常的堆栈跟踪显示我们的某个自定义NuGet包引用了2.4.0.0版本。
查看NuGet包的依赖关系时,它没有显示ServiceRuntime,我认为这是因为它是一个GAC引用(NuGet无法解析): 我发现通过添加以下
我认为只有当2.5.0.0向后兼容2.4.0.0规范时,此方法才能正常运行。
问题:
- 如果它不向后兼容会发生什么? - 为什么 Microsoft.WindowsAzure.ServiceRuntime 不是 NuGet 包?
Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
据我所了解,
Microsoft.WindowsAzure.ServiceRuntime
是一个GAC依赖项,不在NuGet上可用。我的.NET项目引用了Azure SDK 2.5中的ServiceRuntime 2.5.0.0。异常的堆栈跟踪显示我们的某个自定义NuGet包引用了2.4.0.0版本。
查看NuGet包的依赖关系时,它没有显示ServiceRuntime,我认为这是因为它是一个GAC引用(NuGet无法解析): 我发现通过添加以下
web.config
更改,现在可以正常工作:<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.5.0.0" newVersion="2.5.0.0" />
</dependentAssembly>
我认为只有当2.5.0.0向后兼容2.4.0.0规范时,此方法才能正常运行。
问题:
- 如果它不向后兼容会发生什么? - 为什么 Microsoft.WindowsAzure.ServiceRuntime 不是 NuGet 包?