Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[.NET 11] AndroidMessageHandler still throws IOException during upload

Aperta
#12,934 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
56/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
android, csharp

Direzione di ricerca

Start by running the attached repro with the commands in README.md and reviewing AndroidMessageHandler.WriteRequestContentToOutput. Compare the AndroidMessageHandler and SocketsHttpHandler results for the connection reset, and read the related fixes in #11682, #11683, and #11554. Done means this upload failure follows the expected HttpRequestException behavior without treating it as cancellation.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Area: App Runtime needs-triage
Android framework version

net11.0-android (Preview)

Description

I hit System.IO.IOException: Software caused connection abort while uploading to OneDrive after moving my app to .NET 11. The inner exception is Java.Net.SocketException, and the stack points to AndroidMessageHandler.WriteRequestContentToOutput.

The attached repro triggers the same exception types by resetting a connection during a PUT upload. AndroidMessageHandler throws IOException; SocketsHttpHandler throws the expected HttpRequestException. The token is never cancelled.

This looks like a remaining case after #11682. The related fixes in #11683 and #11554 cover cancellation, which doesn't apply here.

The Preview 6 release notes say:

AndroidMessageHandler is brought in line with the HttpClient contract and SocketsHttpHandler behavior

Could this case also be fixed before .NET 11 ships? I simplified my error handling after the migration to catch HttpRequestException for network failures. This error now bypasses the retry and shows an unexpected-error dialog.

Steps to Reproduce
  1. Extract AndroidMessageHandlerUploadAbort-source.zip
  2. Build and run the app on a device or emulator using the commands in README.md.
  3. Read the results on screen or with adb logcat -s UploadAbortRepro:I.

The app runs its own loopback server, which reads the headers and 1 KiB of a 16 MiB upload, then resets the connection with SO_LINGER=0. No external server or account is needed.

Results

Reproduced on three consecutive launches on each device:

Handler Exception from SendAsync Inner exception
AndroidMessageHandler System.IO.IOException Java.Net.SocketException
SocketsHttpHandler System.Net.Http.HttpRequestException System.IO.IOException

The Android handler's stack includes WriteRequestContentToOutput. Both tokens remain uncancelled. I would expect HttpRequestException from both handlers for this network failure.

Environment

  • net11.0-android, SDK 11.0.100-rc.1.26425.128
  • Android workload 37.0.0-rc.1.2257
  • Physical Pixel 7: Android 17 / API 37, arm64
  • Pixel 9a emulator: Android 16 / API 36 (android-36.1 image), x86_64
Lingua principale
C#
Stelle
2.1k
Fork
580
Merge medio
2g 1h
PR unite (30g)
220

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dotnet/android

Tutte le issue di dotnet/android

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.