dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.44k stars 10.02k forks source link

[Android]MessagePack Exception:The transport does not support the 'Binary' transfer #57802

Open BaY1251 opened 1 month ago

BaY1251 commented 1 month ago

Description

I am using SignalR to connect to a server, but there is an exception when using MessagePack.

Comment out line 15,'Exception' no longer pops up

Exception.Message: Unable to connect to the server with any of the available transports. (ServerSentEvents failed: The transport does not support the 'Binary' transfer format.) (LongPolling failed: Error while copying content to a stream.)

Steps to Reproduce

  1. Open /Issue24710/Issue24710.sln
  2. deployment the project
  3. Click "Click me"
  4. Then an 'exception' message will appear

Link to public reproduction project repository

https://github.com/BaY1251/MauiDebug.git

Version with bug

8.0.82 SR8.2

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android7.1

Did you find any workaround?

No response

Relevant log output

StackTrace:

   at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.SelectAndStartTransport(TransferFormat transferFormat, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartAsyncCore(TransferFormat transferFormat, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartAsync(TransferFormat transferFormat, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory.ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory.ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncCore(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncInner(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsync(CancellationToken cancellationToken)
jfversluis commented 1 month ago

Can you please give a bit more context? The linked repo has a lot of code, where do we look? What is the full error message? What have you tried already?

BaY1251 commented 1 month ago

@jfversluis I have updated the context

ninachen03 commented 1 month ago

@BaY1251 I didn't see the 'MessagePack Exception:The transport does not support the 'Binary' transfer' but show Connection failure when use VS 17.12.0. Preview2.0 Maui 8.0.82 image

BrennanConroy commented 1 month ago

https://stackoverflow.com/questions/74792022/why-does-the-android-version-of-my-maui-app-not-have-internet-access

BaY1251 commented 1 month ago

@BaY1251 I didn't see the 'MessagePack Exception:The transport does not support the 'Binary' transfer' but show Connection failure when use VS 17.12.0. Preview2.0 Maui 8.0.82 image

@ninachen03 A server with Message Pack enabled is required. Can someone help you build a simple server?

BaY1251 commented 1 month ago

The last working version is VS-17.8.0