One or more errors occurred.

Jun 13, 2014 at 7:24 AM
Edited Jun 13, 2014 at 7:25 AM

One or more errors occurred.

-2146233088

at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at LinqToTwitter.TwitterQueryProvider.Execute[TResult](Expression expression) at LinqToTwitter.TwitterQueryable1.System.Collections.IEnumerable.GetEnumerator() at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) at SocialNetworks.TwitterFeed.GetItems(String tokenKey, String tokenSecret, String consumerKey, consumerSecret, String account) at SocialNetworks.TwitterFeed.Page_Load(Object sender, EventArgs e)

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. The system cannot find the file specified. File name: 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at LinqToTwitter.Net.GetMessageHandler.d__0.MoveNext() at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at LinqToTwitter.Net.GetMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at LinqToTwitter.TwitterExecute.d__21.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at LinqToTwitter.TwitterContext.d__da`1.MoveNext()

System.Collections.ListDictionaryInternal

mscorlib
Coordinator
Jul 1, 2014 at 4:41 AM
Hi,

LINQ to Twitter has dependencies on
    Microsoft.Net.Http (≥ 2.2.22)
    Microsoft.Bcl.Compression (≥ 3.9.83)
I recently deployed a new version that updated dependencies to the latest libraries. Here it is on NuGet:

http://www.nuget.org/packages/linqtotwitter

@JoeMayo
Jul 30, 2014 at 8:49 AM
I might be missing something, but I'm also getting this error. I just downloaded version 3.0.4 from nuget and when I deploy my code I get this error.

In reflector, it shows that the 3.0.4 assembly is referencing the 1.5.0 version of System.Net.Http.Primitives. Here are some screen shots from reflector.

I've seen on StackOverflow that this can probably be solved by using assemblyBinding in web.config. But I'm trying to use this library in SharePoint, which makes it difficult to change web.config. Is there anything I can do to get this working?

Imgur
Imgur
Imgur
Coordinator
Jul 31, 2014 at 4:49 AM
Hi,

Can you delete the System.Net.Http, System.Net.HttpExtensions, and System.Net.Http.Primitives from your folder and then add the HttpClient NuGet package to your project? You might notice that the demos (Linq2TwitterDemos_...) projects, reference LinqToTwitterPcl.dll, but have their own version of the HttpClient NuGet package.

@JoeMayo
Aug 10, 2014 at 2:03 AM
I do have the HttpClient NuGet package. You can see from the screenshot that I have it loaded from the NuGet package. I'm also deploying the assemblies to the GAC. But it seems like LinqToTwitter is looking for a specific version of the assembly (the older version). Any ideas?
Coordinator
Aug 10, 2014 at 3:47 AM
I'm not that familiar with Sharepoint, but maybe can help point the way. You might be able to re-configure the project and build with updated assemblies. Here's a general description of how to do this:
  1. Download the source code.
  2. Open the LinqToTwitterPcl solution and look at the LinqToTwitterPcl project.
  3. Double-click Properties, go to the Library tab, and click the Change button (in the Targeting section).
  4. Turn off all of the targets that don't apply to what you're doing.
Note: the reason you're seeing the 1.5.0.0 assemblies is because of all these targets and the HttpClient package is installing a least common denominator version that works with all these technologies (or at least that's the theory). There are different things you can do with NuGet and PCL's and I'm looking at those options, but haven't had the opportunity to examine the issue closer.
  1. Update the HttpClient libraries to the version you need. Because you turned off all the unused technologies, you can probably do this with NuGet with either an update or Remove and then add.
  2. Build and physically move the DLLs you need into your project. For non-NuGet assemblies, I use a ReferencedAssemblies folder for the solution, do a manual file reference, and set the CopyToLocal to true to ensure the assemblies copy during build.
I don't know how that plays out in Sharepoint, but am interested in your feedback to both improve the library and as guidance to others in your situation.

@JoeMayo