[Mono-aspnet-list] [Mono] Console application running on Mono 3.2.1 and connected to remote HubConnection is failed

Yedda Hsu yeddahsu at gmail.com
Fri Sep 13 09:02:39 UTC 2013


I tried to create one asp.net web application as SignalR server(OS:
win 7) and deployed one C# console application as SignalR client(OS:
ubuntu 12.10, mono version:Mono JIT compiler version 3.2.1 ).When I
ran console application on ubuntu(Command: mono xxx.exe), I got the
error message as below, could you give me some suggestions for the
issue? Thanks.

=====================================================================
There was an error opening the
connection:System.NotImplementedException: This method must be
implemented in derived classes
  at System.Net.WebRequest.set_ImpersonationLevel
(TokenImpersonationLevel value) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check)
System.Net.WebRequest:set_ImpersonationLevel
(System.Security.Principal.TokenImpersonationLevel)
  at System.Net.Http.WebRequestHandler.CreateWebRequest
(System.Net.Http.HttpRequestMessage request) [0x00000] in <filename
unknown>:0
  at System.Net.Http.HttpClientHandler+<SendAsync>c__asyncC.MoveNext
() [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
[0x00000] in <filename unknown>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult
() [0x00000] in <filename unknown>:0
  at System.Net.Http.HttpClient+<SendAsyncWorker>c__async5.MoveNext ()
[0x00000] in <filename unknown>:0
======================================================================
The source code is:

            var connection = new HubConnection("http://172.19.66.104:8081/");
            IHubProxy myHub = connection.CreateHubProxy("ApiHub");

            connection.Credentials = CredentialCache.DefaultNetworkCredentials;

            try
            {

                myHub.On("broadcastMessage", message =>
                   Console.WriteLine("Receive action: {0} and sending
http post request: schedule?commit={1}&&channelid=999", message,
commitLst[message]));

               connection.Start().ContinueWith(task =>
                {
                    if (task.IsFaulted)
                    {
                        log.Info("There was an error opening the
connection:{0}",
                                          task.Exception.GetBaseException());

                        Console.WriteLine("There was an error opening
the connection:{0}",
                                          task.Exception.GetBaseException());
                    }
                    else
                    {
                        log.Info("Connected");
                        Console.WriteLine("Connected");
                    }

                }).Wait();

                Console.WriteLine("Connection status : " +
connection.State.ToString());

            } catch (Exception e){
                Console.WriteLine(e.Message + e.StackTrace.ToString());

            }

-- 
Best Regards,
Yedda Hsu


More information about the Mono-aspnet-list mailing list