Visual Studio debugger ignores methods in partial classes

I have a partial class split into 5 files of different names. I need to step into the code of one of the methods, but the debugger always seems to jump over them. Every other line works fine (including the constructor for that class), but the methods in the class are all skipped. I tried:

  • Cleaning solution
  • Deleting files .sou

  • Deleting folders bin

    andobj

  • Restarting Visual Studio
  • Rebooting my machine.
  • All of the above again, several times.

I can only guess that the debugger has problems with partial classes in general. Is there any workaround for this other than moving all the code into one file?

+3


source to share


2 answers


Make sure your partial classes are in the same namespace. If all your classes are not in the same namespace, you can apply a partial modifier, everything will be built, but they will not actually be the same class.



0


source


I got this working by doing this:

In Visual Studio open "Tools - Options ...", select "Debug / General" and uncheck "Include only my code"



As suggested here Debugging a Partial Class

0


source







All Articles