none
Error connecting to SignalR from Android Xamarin RRS feed

  • Question

  • I have a problem that is really hard for me to find the fault, I looked for information on all sides I made two million changes and I can't make SignalR walk in the mobile application created with Xamarin Android. The theme is as follows: from VS using the Android emulator the connection to SignalR works fine but when I publish the Android application and use it from my cell phone it doesn't connect and I can see the following error message from Windows Events:

    Event code: 3005 Event message: An unhandled exception has occurred. Event time: 21/1/2020 04:27:08 Event time (UTC): 21/1/2020 07:27:08 Event ID: 76845b1341fb48d3b71f05f2acc1f68f Event sequence: 4 Event occurrence: 1 Event detail code: 0

    Application information: Application domain: /LM/W3SVC/6/ROOT-1-132240652228746740 Trust level: Full Application Virtual Path: / Application Path: C:\inetpub\wwwroot\MT001001\TESTING\WEB\PedidosMcd\ Machine name: IAVTECHVM

    Process information: Process ID: 4740 Process name: w3wp.exe Account name: IIS APPPOOL\MT001001_TESTING

    Exception information: Exception type: ArgumentNullException Exception message: Value cannot be null. Parameter name: key at System.Collections.Generic.Dictionary2.FindEntry(TKey key) at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.AuthorizeRequest(IRequest request) in /_/src/Microsoft.AspNet.SignalR.Core/Hubs/HubDispatcher.cs:line 114 at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(IDictionary2 environment) in //src/Microsoft.AspNet.SignalR.Core/PersistentConnection.cs:line 159 at Microsoft.AspNet.SignalR.Owin.Middleware.HubDispatcherMiddleware.Invoke(IOwinContext context) in //src/Microsoft.AspNet.SignalR.Core/Owin/Middleware/HubDispatcherMiddleware.cs:line 38 at Microsoft.Owin.Infrastructure.OwinMiddlewareTransition.Invoke(IDictionary`2 environment) at Microsoft.Owin.Cors.CorsMiddleware.d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Mapping.MapMiddleware.d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar) at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    Request information: Request URL:...com:443/signalr/negotiate?clientProtocol=2.1&connectionData=[{}]  Request path: /signalr/negotiate User host address: 190.177.1.85 User:
    Is authenticated: False Authentication Type:
    Thread account name: IIS APPPOOL\MT001001_TESTING

    Thread information: Thread ID: 16 Thread account name: IIS APPPOOL\MT001001_TESTING Is impersonating: False Stack trace: at System.Collections.Generic.Dictionary2.FindEntry(TKey key) at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.AuthorizeRequest(IRequest request) in /_/src/Microsoft.AspNet.SignalR.Core/Hubs/HubDispatcher.cs:line 114 at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(IDictionary2 environment) in //src/Microsoft.AspNet.SignalR.Core/PersistentConnection.cs:line 159 at Microsoft.AspNet.SignalR.Owin.Middleware.HubDispatcherMiddleware.Invoke(IOwinContext context) in //src/Microsoft.AspNet.SignalR.Core/Owin/Middleware/HubDispatcherMiddleware.cs:line 38 at Microsoft.Owin.Infrastructure.OwinMiddlewareTransition.Invoke(IDictionary`2 environment) at Microsoft.Owin.Cors.CorsMiddleware.d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Mapping.MapMiddleware.d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar) at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    Custom event details:

    And in IIS I have the transports.log.txt log:

    SignalR.Transports.TransportHeartBeat Information: 0 : Connection 822d31dd-e4f6-4b08-9b65-c080b3ad2eb1 is New. SignalR.Transports.WebSocketTransport Verbose: 0 : Sending outgoing message. Connection id: 822d31dd-e4f6-4b08-9b65-c080b3ad2eb1, transport: WebSocketTransport, message: {"C":"d-5947C291-B,0|C,0|D,1","S":1,"M":[]} SignalR.Transports.WebSocketTransport Verbose: 0 : Sending outgoing message. Connection id: 822d31dd-e4f6-4b08-9b65-c080b3ad2eb1, transport: WebSocketTransport, message: {"R":{"id":"822d31dd-e4f6-4b08-9b65-c080b3ad2eb1","usuario":"TECNICO1","pass":"1234","iniciarauto":true},"I":"0"} SignalR.Transports.WebSocketTransport Error: 0 : OnError(822d31dd-e4f6-4b08-9b65-c080b3ad2eb1, System.Net.WebSockets.WebSocketException (0x80070026): Reached the end of the file at System.Web.WebSockets.WebSocketPipe.<>c__DisplayClass9_0.b__0(Int32 hrError, Int32 cbIO, Boolean fUtf8Encoded, Boolean fFinalFragment, Boolean fClose) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.WebSockets.AspNetWebSocket.d__45`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.WebSockets.AspNetWebSocket.<>c__DisplayClass36_0.<b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNet.SignalR.WebSockets.WebSocketMessageReader.d__3.MoveNext() in /_/src/Microsoft.AspNet.SignalR.Core/Owin/WebSockets/WebSocketMessageReader.cs:line 36 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNet.SignalR.WebSockets.WebSocketHandler.d__25.MoveNext() in /_/src/Microsoft.AspNet.SignalR.Core/Owin/WebSockets/WebSocketHandler.cs:line 170) SignalR.Transports.WebSocketTransport Information: 0 : CloseSocket(822d31dd-e4f6-4b08-9b65-c080b3ad2eb1)

    I have an Azure VM but it does not have an Antivirus installed, only windows defender, I saw elsewhere that it could be the AV but I discard it.

    The strange thing is that from the VS Android emulator I address the signalr path and it connects well. The webapp also connects and works well, it just does not work by running the application from the cell phone with Android (I tested it on several computers).

    try to address with http and https and it works fine from the emulator but not from the Android app

    Can you miss any permission from Xamarin Android?

    I appreciate any help

    Tks

    • Moved by CoolDadTx Friday, January 24, 2020 6:53 PM Not a C# question
    Friday, January 24, 2020 3:58 PM

All replies

  • This forum is for C#-specific questions only. Please post questions related to issues with Xamarin in their forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Friday, January 24, 2020 6:53 PM