HubConnection could not be loaded from SignalR Assembly in Raspberry Pi Mono Project

感情迁移 提交于 2020-01-01 07:16:11

问题


I am trying to build a project in Raspberry Pi which communicates with my Azure server via Signalr. I have used SignalR in .NET client side in a mono project while working on a Xamarin project and was successful. For the test purpose, I have written a small block of code.

using System;
using Microsoft.AspNet.SignalR.Client;

namespace testSignalr1
{
  class Program
  {
    static void Main()
     {
        var hubConnection = new HubConnection("******");
        var serverHub = hubConnection.CreateHubProxy("HubTest");
        serverHub.On("broadcastMessage", message => System.Console.WriteLine(message));
        hubConnection.Start().Wait();
        serverHub.Invoke("TestMethod").Wait();
        System.Console.Read();
    }
  }
}

I am compiling this using mcs mono compiler.

sudo mcs test.cs /r: /usr/lib/mono/4.5/Microsoft.AspNet.SignalR.Client.dll

The program actually compiles successfully. But when it is run, I get the following exception

Could not load type 'Microsoft.AspNet.SignalR.Client.HubConnection' from assembly 'Microsoft.AspNet.SignalR.Client'

The Microsoft.AspNet.SignalR.Client.dll I am using is the one in lib folder in this Git Project which demonstrates SingalR in RaspBerry Pi

This seems to be the mono compiled version of SignalR. I cannot figure out where I am going wrong. Thank You in Advance


回答1:


ssh into the raspberry pi and type sudo apt-get install mono-complete this worked for me. I had the same issue when only installed the mono-runtime.



来源:https://stackoverflow.com/questions/23060026/hubconnection-could-not-be-loaded-from-signalr-assembly-in-raspberry-pi-mono-pro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!