Share via


Can I do a Visual Basic (VB) Stop in C#?

Question

Tuesday, October 23, 2007 11:46 PM | 3 votes

 

I want to share this for the benefit of VB programmers who transformed themselves into C# programmers.

 

In VB you can put "Stop" in the middle of code. When execution gets to the Stop command, execution stops and you are in the debugger. Stop is an alternative to break points.

 

You can do the same thing in C#, but it looks different:

System.Diagnostics.Debugger.Break();

 

That's the C# version of VB Stop, and it does the same thing, as far as I can tell. So, you can VB Stop in C# if you wish.

All replies (1)

Wednesday, October 24, 2007 6:46 PM | 4 votes

 

System.Diagnostics.Debugger.Break();

 

Regards

Flo