Azure的webrole骑自行车和"无法加载文件或程序System.Web.Http 5.2.0.0" [英] Azure webrole cycling and "Could not load file or assembly System.Web.Http 5.2.0.0"

查看:380
本文介绍了Azure的webrole骑自行车和"无法加载文件或程序System.Web.Http 5.2.0.0"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能部署我蔚蓝webrole了,它的循环indefinitly。于是我穿上的IntelliTrace,我发现此异常:

I can't deploy my azure webrole anymore, it's cycling indefinitly. So I put on Intellitrace and I found this exception :

异常:抛出该异常:无法加载由于角色的切入点
  但下列情况除外:
   - System.IO.FileLoadException:无法加载文件或程序集System.Web.Http,版本5.0.0.0 =文化=中立,
  公钥= 31bf3856ad364e35或它的一个依赖。该
  位于集清单定义不匹配的程序集
  参考。 (异常来自HRESULT:0x80131040)

Exception:Thrown: "Unable to load the role entry point due to the following exceptions: -- System.IO.FileLoadException: Could not load file or assembly 'System.Web.Http, Version=5.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)

在我的项目,并web.config中包(的WebAPI,虚拟主机提供商等)都在5.2.0.0,所以我不明白为什么天青试图找到5.0.0.0?!

In my project, web.config and package (Webapi, webhost etc.) are all in 5.2.0.0 so I don't understand why Azure try to find 5.0.0.0 ?!

例如:

<dependentAssembly>
    <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0" />
</dependentAssembly>

你有什么想法?谢谢

Do you have any idea ? Thanks

PS: System.Web.Http 复制了地方:真正的

ps: System.Web.Http got copy local:true

推荐答案

这的IntelliTrace输出是告诉你,WaIISHost.exe崩溃(无法加载的作用入口点)。但是,你的web.config集绑定重定向仅影响W3wp.exe进程。你有几个选择:

That intellitrace output is telling you that WaIISHost.exe is crashing ("Unable to load the role entry point"). But your web.config assembly binding redirect is only affecting the w3wp.exe process. You have a couple options:


  1. 检查你的角色入口点(从RoleEntryPoint,通常WebRole.cs派生类),以确保您引用的System.Web 5.2的DLL。

  2. 与你绑定重定向为WaIISHost过程创建一个config文件。要做到这一点,你将创建一个.dll.config。在默认的Web角色项目,这将是WebRole1.dll.config。

这篇关于Azure的webrole骑自行车和&QUOT;无法加载文件或程序System.Web.Http 5.2.0.0&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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