无法加载文件或程序集ServiceRuntime 2.4.0.0 [英] Could not load file or assembly ServiceRuntime 2.4.0.0

查看:124
本文介绍了无法加载文件或程序集ServiceRuntime 2.4.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将项目升级为使用Azure SDK 2.5之后,部署到Azure(Web角色)时会遇到以下运行时异常:

After upgrading our project to use the Azure SDK 2.5, I get the following runtime exception when deployed to Azure (web role):

无法加载文件或程序集 'Microsoft.WindowsAzure.ServiceRuntime,版本= 2.4.0.0, 文化=中性,PublicKeyToken = 31bf3856ad364e35'或其中之一 依赖关系.系统找不到指定的文件.

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:

One of the referenced packages from NuGet is still referencing ServiceRuntime 2.4.0.0. From what I understand, all I need to do to fix this is create a bindingRedirect in our 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>

不幸的是,这不起作用.异常仍然存在.谁能提供指导?

Unfortunately this doesn't work. The exception persists. Can anyone provide guidance?

推荐答案

我自己升级到SDK 2.5后,遇到了同样的问题.我浏览了解决方案中的所有项目,并检查了对 Microsoft.WindowsAzure.ServiceRuntime 的所有引用.删除它们,然后使用添加引用选项再次添加它们.再次选择该程序集,但是请确保它是2.5.0.0版本.重建并重新部署.事情现在应该可以再次工作.

After upgrading to SDK 2.5 myself i had the same problem you have now. I went trough all of the projects in the solution, and checked all of the references to Microsoft.WindowsAzure.ServiceRuntime. Remove them, and add them again using the Add Reference option. Select the assembly again, however make sure it is the 2.5.0.0 version. Rebuild and redeploy. Things should work again now.

这篇关于无法加载文件或程序集ServiceRuntime 2.4.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆