System.Net.Http NuGet package 4.3.0 reference generates System.IO.FileLoadException on System.Diagnostics.DiagnosticSource ver 4.0.0.0 reference

前端 未结 3 1665
失恋的感觉
失恋的感觉 2021-02-12 23:04

Description of the problem:

A shared library \"shared.dll\" project references System.Net.Http NuGet package 4.3.0. The application that references \"shared.dll\" fails

相关标签:
3条回答
  • 2021-02-12 23:06

    I solved this problem installing System.Net.Http (version 4.3.1) from NuGet.

    0 讨论(0)
  • 2021-02-12 23:20

    I feel it would be factually correct to answer my own question because 99% of the the answer is already there.

    The development team at github/corefx acknowledged this issue resolution would be a side effect of another known issue fix by the nature of removing the hard reference to System.Diagnostics.DiagnosticSource.dll from System.Net.Http project.

    Until then: any of two provided workarounds is OK to use based on personal preferences.

    0 讨论(0)
  • 2021-02-12 23:22

    In my case the

    FileLoadException: Could not load file or assembl y 'System.Diagnostics.DiagnosticSource, Version=4.0.3.0, Culture=neutral, Public KeyToken=cc7b13ffcd2ffffd51'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    started when to Asp.Net Core 2.0 project was added Microsoft.AspNetCore.TestHost package "2.1.0-preview2-final". The fix was to install the stable version "2.0.2"

    0 讨论(0)
提交回复
热议问题