Failed to load file or assembly "System.Net.Http, Version = 4.0.0.0"

I don't know what I did, but I may have removed System.Net.Http 4.0.0.0 from the GAC. I have a Windows Portable Library that targets WinRT, which compiles and works fine, and now I get the following error every time I try to start it

Failed to load file or assembly "System.Net.Http, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a" or one of its dependencies. The system cannot find the specified file. ":" System.Net.Http, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a

How can I add System.Net.Http 4.0.0.0 ? Every time I search for .dll, I find version 2.0.0.0?

+4
source share
4 answers

To restore this in versions of Windows prior to Windows 8, go to Add or Remove Programs and install the .NET Framework 4.5 hotfix.

To associate this with versions of Windows 8 and above, you will need to run System Restore to restore Windows binaries to an earlier version when it works.

+8
source

Did you try to remove and then re-add the link from the project?

+1
source

Try the folder:
C: \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.0
and copy the dll to the GAC using the gacutil tool from the folder
C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ Bin

0
source

If this were so, but now not, it is likely that you changed something in your project, if I understand correctly that you are creating a portable library (and not the Windows Store), if so, you probably changed that, that the plataforms you are targeting, go to "Project Properties" and "Library"> "Target Structures" click "Edit", there, if you selected everything or selected .NET Framework 4.0.3, then System.Net.Http is not allowed To solve this problem, you need to exit some options and enable the .NET Framework 4.5, since this is the minimum version to use System.Net.Ht tp.

0
source

Source: https://habr.com/ru/post/1436503/


All Articles