我有一个.Net Framework 4.7.1web表单应用程序和.netframework4.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标准以来,我看到了有关程序集冲突的更多问题。
你能给我解释一下吗
一。程序集发生了什么,为什么我需要打开绑定重定向?
2。为什么这不能解决第二个问题?
谢谢您。