System.Net.Http.Primitives not resolving

Apr 12, 2014 at 10:47 PM
I am using the linqtotwitter 3.0.2 (this version) from Nuget. After installing it and writing a simple search, I am getting this exception:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

This occurred in both a F# and C# project on 2 different machines (Win7 and Win 8)

When I uninstall the 3.x version and install the latest 2.x version from Nuget, it works like a champ. Install-Package linqtotwitter -Version 2.1.11

After reading some posts on StackOverflow, it seems like the GAC is overriding the assembly version. Is this some other people have seen and if so, how did you correct?

Thanks
May 8, 2014 at 12:55 PM
Same here linqtotwitter 3.0.2 with 4.2.20.0 of System.Net.Http.Primitives


Could not load file or assembly 'System.Net.Http.Primitives, Version=4.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040
Sep 12, 2014 at 1:33 PM
What it solved for me was to deploy the .config that has the same name as your .exe along with the exe. In the config, you will find the following lines:
<dependentAssembly>
  <assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-4.2.22.0" newVersion="4.2.22.0" />
</dependentAssembly>
Marked as answer by JoeMayo on 9/12/2014 at 10:51 AM
Coordinator
Sep 12, 2014 at 6:05 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.