I often come across a situation where I want to disable some code during debugging without actually changing the code.
As a result, I get a breakpoint (usually conditional), and then when the breakpoint fires, I execute the Set Next command. This can be very time consuming when the code is reached many times, so I created a macro:
Sub Skip3Lines() DTE.ActiveDocument.Selection.LineDown(False, 3) DTE.Debugger.SetNextStatement() End Sub
Then I changed my breakpoint as a hit point ( right-click -> When Hit... ) and told her to execute this macro.
Visual Studio was too happy to spit out the following dialog box:
---------------------------
Error
---------------------------
A macro called a debugger action which is not allowed while responding to an event or while being run because a breakpoint was hit.
---------------------------
OK
---------------------------
Does anyone know how to get around this?
debugging visual-studio
Motti
source share