Skip to content

[maui][hot-reload][vs] VS exits debug mode after changing C# code, applying Hot Reload and adding breakpoints afterwards #115307

Open
@mauroa

Description

@mauroa

Description

Creating this bug based on a private one reported in AzDO: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1921946

When you use a .NET MAUI app during a debug session, apply C# code changes with Hot Reload and then add breakpoints, the debug session ends abruptly.

This issue reproduces with both the old Mono debug engine (mono/debugger-libs) and the new Monod debug engine (Concord monomscordbi), for this reason and after analyzing this with @thaystg, we consider this to be an issue on the runtime side.

Reproduction Steps

1 - Open VS
2 - Create or open an existing .NET MAUI project
3 - Select an Android emulator from the debug targets list in VS
4 - Start a debug session (F5)
5 - Once the debug session is started, change some C# code (e.g: open MainPage.xaml.cs and change code "count++" to "count--") and save the changes
6 - Apply Hot Reload (small flam icon)
7 - Add a breakpoint in the class that you just changed the code

Expected behavior

The breakpoints are added correctly after applying Hot Reload, and can be hit as part of the debug session

Actual behavior

After applying Hot Reload and adding the breakpoints, the debug session ends. This is suspected to be a runtime issue that causes the debug session/connection to end

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

Labels

area-EnC-monoHot Reload for WebAssembly, iOS/Android, etc

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions