gpt4 book ai didi

azure - 无法加载文件或程序集 ServiceRuntime 2.4.0.0

转载 作者:行者123 更新时间:2023-12-03 23:45:27 26 4
gpt4 key购买 nike

升级我们的项目以使用 Azure SDK 2.5 后,在部署到 Azure(Web 角色)时出现以下运行时异常:

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.

NuGet 引用的包之一仍然引用 ServiceRuntime 2.4.0.0。据我了解,解决此问题所需要做的就是在我们的 web.config 中创建一个 bindingRedirect:

<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>

不幸的是,这不起作用。异常仍然存在。谁能指导一下吗?

最佳答案

我自己升级到 SDK 2.5 后,遇到了与您现在相同的问题。我检查了解决方案中的所有项目,并检查了对 Microsoft.WindowsAzure.ServiceRuntime 的所有引用。删除它们,然后使用添加引用选项再次添加它们。再次选择该程序集,但请确保它是 2.5.0.0 版本。重建并重新部署。现在一切应该恢复正常了。

关于azure - 无法加载文件或程序集 ServiceRuntime 2.4.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29115731/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com