I want to set a breakpoint on a certain line in C# code when some other variable is equal to a specific value, say:
MyStringVariable == "LKOH"
How can I do that?
I tried to right click on breakpoint icon -> Condition and then typed MyStringVariable == "LKOH"
and Visual Studio said it cannot evaluate it.
if (MyStringVariable == "LKOH") Debugger.Break();
you'll need System.Diagnostics namespace
http://msdn.microsoft.com/en-us/library/system.diagnostics.debugger.break.aspx