Android framework version
net11.0-android (Preview)
Affected platform version
Android 16
Description
As per the post by @davidortinau last week, we have been testing how .NET 11 Preview 6 compares with .NET 10. We noticed that when upgrading a .NET MAUI Android application from .NET 10 (Mono) to .NET 11 (CoreCLR), the application silently freezes at startup and then exits with code 0 if the project's Platforms/Android/Environment.txt contains:
DOTNET_DiagnosticPorts=127.0.0.1:9000,suspend,connect
This setting was commonly used (and sometimes recommended) for Mono debugging on Android. On the Mono runtime, the Xamarin debugger tooling handled this diagnostic port connection seamlessly. However, on CoreCLR in .NET 11, the runtime interprets this literally; it suspends at startup and waits indefinitely for a diagnostic client to send a ResumeStartup command via IPC. Since the VS debugger doesn't connect using this mechanism on CoreCLR, the app hangs and eventually exits silently.
Why This Is Critical
- Silent failure: The app exits with code 0 and no crash, exception, or error message. There is no indication of what went wrong.
- Difficult to diagnose: The only clue is a single line in logcat:
The runtime has been configured to pause during startup and is awaiting a Diagnostics IPC ResumeStartup command from a Diagnostic Port. which is easily missed or misinterpreted.
- Common configuration: Many existing .NET Android projects have this line in
Environment.txt from Mono/Xamarin-era setup guides.
- Migration trap: Developers upgrading to .NET 11 will hit this immediately with no obvious path to resolution.
Expected Behavior
One or more of the following:
- A build warning when targeting .NET 11 CoreCLR and
Environment.txt contains DOTNET_DiagnosticPorts with suspend alerting the developer that this is incompatible with CoreCLR on Android.
- A migration guide entry documenting that this setting must be removed when upgrading from Mono to CoreCLR.
- The runtime or Android tooling ignoring or overriding the
suspend mode when launched from the IDE debugger.
Actual Behavior
The app silently hangs at startup and exits with code 0. No error, no crash, no warning.
Environment
- .NET SDK: 11.0.100-preview.6 (or later)
- Previous SDK: .NET 10 (Mono runtime)
- Platform: Android (arm64)
- IDE: Visual Studio 2026
Steps to Reproduce
- Take any .NET MAUI Android project that was previously targeting
net10.0-android.
- Ensure
Platforms/Android/Environment.txt contains:
DOTNET_DiagnosticPorts=127.0.0.1:9000,suspend,connect
- Change
TargetFrameworks to net11.0-android.
- Build and deploy to an Android device.
- The app will launch, appear to do nothing, and then exit silently.
Did you find any workaround?
Remove the DOTNET_DiagnosticPorts line from Environment.txt:
-DOTNET_DiagnosticPorts=127.0.0.1:9000,suspend,connect
MONO_GC_PARAMS=nursery-size=128m
Relevant log output
### Logcat Output
I/DOTNET (27334): The runtime has been configured to pause during startup and is awaiting a Diagnostics IPC ResumeStartup command from a Diagnostic Port.
I/DOTNET (27334): DOTNET_DiagnosticPorts="127.0.0.1:9000,suspend,connect"
I/DOTNET (27334): DOTNET_DefaultDiagnosticPortSuspend=0
The program 'MyApp.dll' has exited with code 0 (0x0).
Android framework version
net11.0-android (Preview)
Affected platform version
Android 16
Description
As per the post by @davidortinau last week, we have been testing how .NET 11 Preview 6 compares with .NET 10. We noticed that when upgrading a .NET MAUI Android application from .NET 10 (Mono) to .NET 11 (CoreCLR), the application silently freezes at startup and then exits with code 0 if the project's
Platforms/Android/Environment.txtcontains:This setting was commonly used (and sometimes recommended) for Mono debugging on Android. On the Mono runtime, the Xamarin debugger tooling handled this diagnostic port connection seamlessly. However, on CoreCLR in .NET 11, the runtime interprets this literally; it suspends at startup and waits indefinitely for a diagnostic client to send a
ResumeStartupcommand via IPC. Since the VS debugger doesn't connect using this mechanism on CoreCLR, the app hangs and eventually exits silently.Why This Is Critical
The runtime has been configured to pause during startup and is awaiting a Diagnostics IPC ResumeStartup command from a Diagnostic Port.which is easily missed or misinterpreted.Environment.txtfrom Mono/Xamarin-era setup guides.Expected Behavior
One or more of the following:
Environment.txtcontainsDOTNET_DiagnosticPortswithsuspendalerting the developer that this is incompatible with CoreCLR on Android.suspendmode when launched from the IDE debugger.Actual Behavior
The app silently hangs at startup and exits with code 0. No error, no crash, no warning.
Environment
Steps to Reproduce
net10.0-android.Platforms/Android/Environment.txtcontains:TargetFrameworkstonet11.0-android.Did you find any workaround?
Remove the
DOTNET_DiagnosticPortsline fromEnvironment.txt:-DOTNET_DiagnosticPorts=127.0.0.1:9000,suspend,connect MONO_GC_PARAMS=nursery-size=128mRelevant log output