加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – Azure webrole循环和“无法加载文件或程序集System.Web.Ht

发布时间:2020-12-16 02:02:33 所属栏目:百科 来源:网络整理
导读:我再也无法部署我的天蓝色webrole,它无限循环.所以我穿上了Intellitrace,我发现了这个异常: Exception:Thrown: “Unable to load the role entry point due to the following exceptions: — System.IO.FileLoadException: Could not load file or assembly
我再也无法部署我的天蓝色webrole,它无限循环.所以我穿上了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)

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

你有什么主意吗 ?谢谢

ps:System.Web.Http得到了本地复制:true

解决方法

intellitrace输出告诉你WaIISHost.exe崩溃(“无法加载角色入口点”).但是您的web.config程序集绑定重定向仅影响w3wp.exe进程.你有几个选择:

>检查角色入口点(从RoleEntryPoint派生的类,通常是WebRole.cs),以确保引用System.Web 5.2 DLL.>使用绑定重定向为WaIISHost进程创建.config文件.为此,您将创建一个.dll.config.在默认Web角色项目中,这将是WebRole1.dll.config.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读