4
votes

I have tried adding the Signalr Client library and the WebApi client package to my Xamarin Solution (on Visual Studio with Xamarin Support and also on Xamarin Studio) but I always get this error although I am able to install other PCLs (for example Microsoft.Net.Http):

Could not install package 'Microsoft.AspNet.WebApi.Client 5.2.3'. You are trying to install this package into a project that targets 'portable-net45+sl50+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

and the following error when adding Signalr:

Adding Microsoft.AspNet.SignalR.Client...
Adding 'Microsoft.AspNet.SignalR.Client 2.2.0' to Corda.Client.
Could not install package 'Microsoft.AspNet.SignalR.Client 2.2.0'. You are trying to install this package into a project that targets 'portable-net45+sl50+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

I have also tried changing the the target framework with not success. This is the build setting for my project: Project settings

and this is my C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile259\SupportedFrameworks folder: PCL profiles folder

I get the same errors on both Mac OSX and Windows 10. Any ideas?

4

4 Answers

2
votes

Using Profile78 solved my problem. Full explaination here. enter image description here

0
votes

A simple workaround that worked with my Xamarin with VS:

  1. Download the dll-files manually here: https://components.xamarin.com/gettingstarted/signalr/true
  2. Import the following into your solution.
    • Microsoft.AspNet.SignalR.Client.dll
    • Newtonsoft.Json.dll
    • System.Net.Http.Extensions.dll
    • System.Net.Http.Primitives.dll
  3. Done!

The problem is not with the dll-files, but with the (nuget) installer.

0
votes

The problem is with the nuget package manager,specifically with the Windows Phone 8.1 project. I think it expects it to be a windows phone silverlight 8.1 project. There is a bug on installing signalr client on an universal 8.1 phone project in a xamarin project. It should be sorted out in the next xamarin release. Unselecting windows phone 8.1 in the portable config solves the issue,meaning you will have to take the windows phone 8.1 project out of the xamarin project and your need to create a universal windows 10 project.

0
votes

Yes, As suggested by others this is the problem from nuget package manager, As per this link it should be fixed with the realease of Microsoft.signalr.client 2.2.1 version but for now if you still want to go with nuget, Add the below nuget source https://www.myget.org/F/aspnetwebstacknightly/ to visual studio and install pre release version 2.2.1 pre-160523-b816 of the signalr client dll as suggested in below link https://github.com/SignalR/SignalR/issues/3393