Could not load file or assembly System.Net.Http version 4.1.1.0

前端 未结 8 1360
春和景丽
春和景丽 2020-12-09 14:55

I\'m porting a Net Framework 4 dll to Net Core. When porting my unit tests project I get an exception running some specific tests (not all).

System.IO

8条回答
  •  萌比男神i
    2020-12-09 15:05

    I had this problem, while I had 10 projects depending on each other. I fixed that by adding the version that it asked for in one of the projects that was dependent on. It was not needed for compilation, but it seems that adding it, fixed the version in other projects while restoring. So it was:

    Could not load file or assembly 'System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

    Then:

    Could not load file or assembly 'System.Net.Http, Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

    So I added "System.Net.Http": "4.1.1", in one project..

    That actually fixed the problem while it restored 8 projects.

提交回复
热议问题