If you are used to using Debug.WriteLine in VB.NET, it is sometimes a little confusing when you try to do it in C# and it doesn't work. The trick is to say:
using System.Diagnostics;
at the beginning of the C# app, then the Debug.WriteLine will work as you expect.
You can get more detailed information on this subject from:
http://support.microsoft.com/kb/815788
I was thrilled to learn of Debug.WriteLine a few months ago--it made life so much easier.
ReplyDeleteThanks for the post.
ReplyDeleteI was trying to figure out where the Debug.WriteLine functions were.
This is great but does not always work. Visual Studio 2008 debugger is buggy! Another workaround however: simply use Console.WriteLine("your message here"); and then, when in debug mode (F5), the output to Console will appear in the Output tab for windows (assuming your program is a Windows Forms program and you are not using the Console to display), under the "Show Output from Debug" option (which should be the default)
ReplyDelete'using System.Diagnostics;'
ReplyDeleteExactly what I was looking for as a new .NET dev, thanks man.