Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2022 - Just My Code debugging not working?

I'm using VS 2022 and no matter what setting I change, I can't get the thing to stop trying to step into compiled dependencies. I have an exception that is occurring that gets swallowed up and this is presented:

enter image description here

I've tried resetting my C# settings for VS22 and I've ensured Just My Code is enabled.

enter image description here

like image 982
Matt M Avatar asked Jan 19 '26 01:01

Matt M


2 Answers

The first time you uncheck "Enable Just My Code" under options - Debugging - General, the box will be greyed out and you will be UNABLE to re-check the box. Because Microsoft :D

General

However, there is a fix for this that doesn't include resetting the whole IDE settings, as some have suggested.

Go to Debugging - Symbols, and click on "Load only specified modules" radio button. Then click on "Specify included modules" below and be sure that there are no modules selected there.

Symbols

Then, press OK and RESTART visual studio.

After VS has restarted, go to options - Debugging - General and now you'll be able to re-check "Enable Just My Code".

It's a bit ridiculous, but that's the best way to do it.

like image 53
Viperus Avatar answered Jan 21 '26 01:01

Viperus


As a workaround, select "Load only specified modules" and click on "Specify included modules". Either leave the list empty or make sure the module VS is attempting to debug is not listed there.

enter image description here

It seems if symbols have been loaded for an external library, Visual Studio would ignore "Enable just my code" and still attempting to debug that library, which is really annoying.

like image 43
derloopkat Avatar answered Jan 21 '26 00:01

derloopkat