Reputation: 2440
I'm trying to create a Xamarin.Forms PCL client for SignalR. Every tutorial I found it's how to add SignalR to either Xamarin.Android or Xamarin.iOS. How can I add SignalR to Xamarin.Forms project?
Thanks for help,
Here's the problem I'm getting: I have a fully working Xamarin.Forms PCL project. I removed all windows stuff though. I just left PCL, iOS and Android projects. It works! I added CocosSharp only, but don't use it. Plain, empty, never touched Xamarin.Forms. Then I've added SingalR to PCL project. Complied, run - works! BUT when I add JUST this line:
var connection = new HubConnection("http://localhost:52128");
it doesn't even compile. I'm getting errors:
Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. Perhaps it doesn't exist in the Mono for Android profile
I'm totally lost.
I've tried:
Installing nuget just on the PCL - error
Installing on every project - error
Creating new PCL, implementing that line there, adding it as a reference to the main PCL. Calling a method from the second PCL - error.
Upvotes: 4
Views: 3059
Reputation: 16652
I met the same error as you did, it seems that when installing SignalRMicrosoft.AspNet.SignalR.Client
package, the dependency packages cannot be automatically installed, the references got somehow corrupted.
To solve this issue, you can manually install those packages.
Install the following three Packages separately from Nuget:
SignalRMicrosoft.AspNet.SignalR.Client.
Upvotes: 5