Whenever I have a NuGet error such as these I usually take these steps:
Taking all of these steps almost always restores all the packages and dll's I need for my MVC program.
EDIT >>>
For Visual Studio 2013 and above, step 2) should read:
Remove all code references to System.Net.*
in the package window,
Install-Package Microsoft.AspNet.WebApi.Client
Clean and rebuild your project
I found an extra
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.28.0" newVersion="2.2.28.0" />
</dependentAssembly>
in my web.config. removed that to get it to work. some other package I installed, and then removed caused the issue.
user3919888 pointed me in the right direction, but I needed to run Update-Package -reinstall Microsoft.AspNet.WebApi.Client
in the Package-Manager console. Basic install by itself does not recognize the problem but does recognize that the package is already installed and does not overwrite it.
I'm posting this answer because this happens so infrequently that I end up googling and reaching this page before I remember what I did last time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With