VS2022: Debug doesn't stop at breakpoint. The debugger is not properly installed. Cannot debug the requested type of code

Viewed 1361

I encountered this issue after unloading and reloading a unit test project (MSUNIT), and the debug didn't stop at any breakpoints and skipped all of them, but the tests were running fine. Other projects within the same solution can debug normally, but only this project skipped breakpoints during debugging. I realize this could be from a number of reasons but none of the answers in SO helped.

1 Answers

In my case, this is due to a missing debug profile for the project. I'm not sure how did it go disappear, I assume this happened after I unloaded and reloaded my project. So if you have tried other solutions and it didn't work, this is worth a try.

Make sure the current startup project is the project you want to look at, for eg: Application.UnitTests.

enter image description here

Next to the Startup Project's drop down list, select [project name] Debug properties. Note: WSL is the default option if no profile is found.

enter image description here

A new window will pop up and a profile should be available there to allow the debug to work but in my case, I couldn't see any profile.

Create a new project profile by clicking this icon and choose Project:

enter image description here

Rename the profile by clicking this icon:

enter image description here

This is how it should look like after adding and renaming a Project profile, that's it:

enter image description here

Close the window.

Next to the Startup Project's drop down list, select the new profile.

enter image description here

Try to debug again, it should start working again and stop skipping the breakpoints.

Related