Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not 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 that was compiling and working fine, and now I get the following error every time I try and run it

Could not 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 file specified.":"System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

how can I re-add System.Net.Http 4.0.0.0? Every time I look for the .dll, I find the 2.0.0.0 version?

like image 566
joe_coolish Avatar asked Jan 16 '23 11:01

joe_coolish


2 Answers

To repair this on versions of Windows prior to Windows 8, go to Add or Remove Programs and do a repair install of the .NET Framework 4.5.

To pair this on versions Windows 8 or greater, you will need to run System Restore to restore Windows binaries to an earlier version when it did work.

like image 199
David Kean Avatar answered May 13 '23 20:05

David Kean


Have you tried to delete, then re-add the reference from the project?

like image 42
Seth Greenstein Avatar answered May 13 '23 21:05

Seth Greenstein