Search code examples
visual-studiovisual-studio-2008debuggingbreakpoints

Visual Studio 2008 - Is there a way to set a breakpoint for when a class is accessed?


I don't really care which line in a class was hit. I just want to know when the class is accessed.


Solution

  • If it's an instantiable class, put a break point in the constructor. If it has static methods or properties, you would have to put a breakpoint in the first line of each method/property. As far as I know, that's the only way to break when a class is accessed.