【发布时间】:2019-01-12 08:58:45
【问题描述】:
我有一个 .Net Framework 4.7.1 Web 表单应用程序和 .Net Framework 4.7.1。 WebJob,两者都在 Azure AppService 上运行。
自从通过 Nuget WebJob 包从 2.0.0 更新到 2.2.0 后,出现了一些依赖问题。
第一个在运行时出现:
System.IO.FileLoadException : Could not load file or assembly 'System.Net.Http, Version=4.1.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference
编译过程中的第二个显示:
Consider app.config remapping of assembly 用于许多程序集,例如 System.Net.Http、System.Net.Sockets、System.IO.Compression 等。
为了解决这个问题,请参考我添加的源数量和编译器警告
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
这已允许执行 WebJob,但编译器仍会在程序集重新映射时显示警告。
自从我相信 .Net Standard 以来,我看到了更多关于程序集冲突的问题。
你能给我解释一下吗 1. 程序集发生了什么以及为什么我需要打开绑定重定向? 2. 为什么这不能解决第二个问题?
谢谢。
【问题讨论】:
标签: c# .net nuget assemblies azure-webjobs