Windows Phone Developers

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;
}


Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment

kbAlertz.com :: Visual Studio 2005

kbAlertz.com :: Visual Studio 2008

kbAlertz.com :: Visual Basic 2005