Skip to content

dotnet run Ctrl+C does not stop the app on the device #11264

@jonathanpeppers

Description

@jonathanpeppers

Description

When running an Android app via dotnet run targeting an emulator and pressing Ctrl+C to stop, the app is not properly closed on the device. Instead, you get:

Stopping application...
Error: The operation was canceled.

Steps to Reproduce

  1. Start an Android emulator
  2. Run:
    dotnet run -f net11.0-android --device emulator-5554
    
  3. Wait for the app to deploy and launch
  4. Press Ctrl+C in the terminal

Expected Behavior

The app should be stopped on the device/emulator and dotnet run should exit cleanly.

Actual Behavior

The terminal outputs:

Stopping application...
Error: The operation was canceled.

The app is not closed on the emulator.

Environment

  • .NET 11 Preview 4 (dotnet-sdk-11.0.100-preview.4)
  • Terminal: VS Code integrated terminal
  • OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssues that need to be assigned.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions