Search doesen't work!

Feb 13, 2014 at 12:57 PM
Hello @all

I want to start with a simple search example but I'm not able to get it work...i always get the error message - and did not find any help in google search for this:
Could not load file or assembly 'System.Net.Http.Primitives, Version=, 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)

This is what I want to do:
public async void SearchFor()
        var auth = new SingleUserAuthorizer
            CredentialStore = new SingleUserInMemoryCredentialStore
                ConsumerKey = ConsumerKey,
                ConsumerSecret = ConsumerSecret,
                AccessToken = AccessToken,
                AccessTokenSecret = AccessTokenSecret

        var twitterCtx = new TwitterContext(auth);

        var searchResponse = await
            (from search in twitterCtx.Search
             where search.Type == SearchType.Search &&
                   search.Query == "LINQ to Twitter"
             select search)

        if (searchResponse != null)

Thanks for any help
Feb 13, 2014 at 4:03 PM
Hi Rene,

LINQ to Twitter v3.0 has a dependency on HttpClient, which is available via NuGet. It looks like something isn't quite right with your project references. I'm curious why:
  • Did you add LINQ to Twitter via NuGet or through downloads?
  • Did you have a previous version of System.Net.Http.Primitives reference?
  • What technology are you using (e.g. Windows Phone, ASP.NET, etc.)?
Feb 17, 2014 at 2:24 PM
Hi JoeMayo,

Thanks for reply! I did not found the System.Net.Http.Primitives.dll on my system. I take it form your download files and insert with add reference.

Thanks for help
Feb 17, 2014 at 4:04 PM
You can add them from NuGet:
  1. Right-click on References and select Manage NuGet Packages.
  2. Search for HttpClient.
  3. Install the Microsoft HttpClient Libraries.
If you add LINQ to Twitter from NuGet, these dependencies should be added automatically.
Feb 18, 2014 at 9:16 AM
Yes, JoeMayo i chosse the the way and install LINQ to twitter with the NUGet and now it works! Thx very much! Rene