简体   繁体   English

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”

I can't deploy my azure webrole anymore, it's cycling indefinitly. 我再也无法部署我的天蓝色webrole,它无限循环。 So I put on Intellitrace and I found this exception : 所以我穿上了Intellitrace,我发现了这个异常:

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) 异常:抛出:“由于以下异常,无法加载角色入口点: - System.IO.FileLoadException:无法加载文件或程序集'System.Web.Http,Version = 5.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(HRESULT的异常:0x80131040)

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 ?! 在我的项目中,web.config和包(Webapi,webhost等)都在5.2.0.0中,所以我不明白为什么Azure试图找到5.0.0.0?

Example: 例:

<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 got copy local:true ps: System.Web.Http得到了本地复制:true

That intellitrace output is telling you that WaIISHost.exe is crashing ("Unable to load the role entry point"). intellitrace输出告诉你WaIISHost.exe崩溃(“无法加载角色入口点”)。 But your web.config assembly binding redirect is only affecting the w3wp.exe process. 但是您的web.config程序集绑定重定向仅影响w3wp.exe进程。 You have a couple options: 你有几个选择:

  1. Check your role entry point (the class that derives from RoleEntryPoint, typically WebRole.cs) to make sure you are referencing System.Web 5.2 DLLs. 检查角色入口点(从RoleEntryPoint派生的类,通常是WebRole.cs),以确保引用System.Web 5.2 DLL。
  2. Create a .config file with your binding redirect for the WaIISHost process. 使用WaIISHost进程的绑定重定向创建.config文件。 To do this you would create a .dll.config. 为此,您将创建一个.dll.config。 In a default web role project this would be WebRole1.dll.config. 在默认Web角色项目中,这将是WebRole1.dll.config。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集&#39;System.Web.Http,Version = 5.2.2.0 - Could not load file or assembly 'System.Web.Http, Version=5.2.2.0 无法加载文件或程序集“ System.Web.Http”或其依赖项之一 - Could not load file or assembly 'System.Web.Http' or one of its dependencies .net core 3.0 无法加载文件或程序集“System.Web.Http 版本=5.2.7.0” - .net core 3.0 Could not load file or assembly 'System.Web.Http Version=5.2.7.0' 从 2012 年到 2013 年更新后无法加载文件或程序集“System.Web.Http 4.0.0” - Could not load file or assembly 'System.Web.Http 4.0.0 after update from 2012 to 2013 简单的注入器依赖解析错误 - 无法加载文件或程序集 System.Web.Http - Simple Injector Dependency Resolution Error - Could not load file or assembly System.Web.Http 无法使用 System.Web.Http 加载文件或程序集,版本 = 4.0.0.0 - Cannot load file or assembly with System.Web.Http, Version=4.0.0.0 无法加载文件或程序集System.Web.Http - Can not load file or assembly System.Web.Http 天蓝色错误部署无法解析此参考。 无法找到程序集System.Web.Http,版本= 4.0.0.0 - Deploying in azure error Could not resolve this reference. Could not locate the assembly System.Web.Http, Version=4.0.0.0 从vs2013升级到vs2017后无法加载文件或程序集&#39;System.Web.Http,Version = 4.0.0.0&#39; - Could not load file or assembly 'System.Web.Http, Version=4.0.0.0' after upgrading from vs2013 to vs2017 无法加载文件或程序集&#39;System.Web.Http.Owin&#39; - Could not load file or assembly 'System.Web.Http.Owin'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM