Visual Studio .NET Tips and Tricks, VB.NET Code Samples, C# Code Snippets, ASP.NET Code Samples, .NET Tips and Tricks, C# Tips & Tricks, Visual Studio 2010, .NET Framework Code Samples, VB.NET Tips & Tricks
Saturday, April 3, 2010
Debug.Print and Debug.Assert in C#
VB Programmers would have used Debug.Print and Debug.Assert at will while debugging the code. These two statements come handy for efficient debugging of the code.
This can be done in C# using System.Diagnostics
using System.Diagnostics;
missing the above directive will cause 'The name 'Debug' does not exist in the current context" error
int i1 = 0; while (i1 < 10) { Debug.Assert(i1 != 3); ++i1; }
No comments:
Post a Comment