Search code examples
xamarin.formsxamarin.androidsignalr.clientasp.net-core-signalr

using signalr client with xamarin forms


I am trying to install Microsoft.AspNetCore.SignalR.Client on Xamarin forms (on .net standard 2.0) and run the android app. I keep getting the error

Could not load assembly 'System.Threading.Tasks.Extensions' during startup registration

I have tried installing System.Threading.Tasks.Extensions nuget's latest prerelease, I still get the same error. I did not find any one else with this issue online.


Solution

  • You need Visual Studio 2017 Update 15.8 + Microsoft.AspNetCore.SignalR.Client Package with at least Version 1.0.1

    ASP.NET Core 2.1.1 contains fixes to resolve blocking issues when using the SignalR Client from Xamarin. However, these fixes also require an updated build of Xamarin.iOS and Xamarin.Android, as well as some additional dependencies.

    In order to use the SignalR Client in Xamarin applications you will need to:

    Upgrade Microsoft.AspNetCore.SignalR.Client to 1.0.1. 
    Upgrade Xamarin to the appropriate version:
        Xamarin.Android 8.4.0.1
    

    VS2017 Update 15.8 comes with Xamarin.Android 9.0.x tools which contains the fix for the issue.