runtime: dotnet watch (net 6.0 preview 5) - attach to process... not working and no breakpoints hit #18538

Description

I’m trying .net 6 preview 5, I created a blazor webassembly project using the default template. Next I go to the Server project open a command prompt and run dotnet watch.

I go to the counter.razor page and put a breakpoint on currentCount++; (line 15) In Microsoft Visual Studio Enterprise 2019 Preview (Version 16.11.0 Preview 2.0) I Go to Debug -> Attach to Process…

Issues

  1. In previous versions of Visual Studio 2019 I could find the processor name belonging to my application. I can’t seem to find the processor exe file listed anymore. Just doesn’t show up in the list.
  2. So I decided to run dotnet watch --no-hot-reload this time the processor name is displayed in the list and I am able to choose it. But my breakpoint never gets hit
  3. I next decide to abandon using the dotnet cli and instead just press F5 from within Visual Studio it brings up the it’s cli window and opens the site and breakpoints work correctly.
  4. Using debugging through Visual Studio I noticed that if I tried to change the counter.razor by updating the <h1> tag nothing changed. Are edits not supported while debugging?

Questions

  1. Differences between trying to use the dotnet cli directly and trying to attach the process? Why can’t I use Debug->Attach to Process and have my breakpoints hit?
  2. Is hot module reloading disabled when debugging within visual studio? i.e. can I edit the the razor page and expect to see pages?

This issue also happens with other app types such asp asp.net core mvc

Configuration

.NET 6.0 preview 5 Visual Studio Enterprise 2019 Preview (Version 16.11.0 Preview 2.0)

Other information

https://github.com/dotnet/sdk/issues/18538

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (13 by maintainers)

Most upvoted comments

is dotnet run of the server project, followed by an attach from VS expected to work for debugging the client-side app in preview 5

Spoke to our resident debugger expert (@captainsafia) and it sounds like that has never worked. The app must be launched with debugger attached for WASM debugging to work.