Sign in to follow this  

[.net] Different debugging methods

This topic is 4200 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was curious about different debugging methods, and by debugging i don't mean stepping through your code. I was more interrested in what built-in features there are in .net and vs that allows me to print out debug messages in different ways without having to create a class of my own for debugging. [Edited by - Cybrosys on June 14, 2006 8:49:22 AM]

Share this post


Link to post
Share on other sites
VS2005 actually added some support for exactly what you're describing. However, it isn't in the Express edition for C# or VB. It is in C++ express, if that's what you're using, as well as (I believe) Standard Edition and higher.

These are called tracepoints. To use them, you can right click on the red circle for a breakpoint you have set. If you are using the appropriate version of VS, you'll get a context menu with several options. These allow you to set things like hitcount (how many times the BP must be hit before breaking,) condition (some expression that must be true for the bp to be hit,) and an option called "When Hit..." It's this last one that you want - it allows you to set a breakpoint that doesn't break, but rather outputs some text.

If you don't have that version of VS, or you want to do it from your code rather than the IDE, take a look at the System.Diagnostics.Debug class. System.Diagnostics.Debug.Write will output some text to the output window in Visual Studio (or whatever debug listener is registered.)

Hope that helps.

Share this post


Link to post
Share on other sites

This topic is 4200 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this