Solved

Tracing Tools for .NET Windows Application

Posted on 2012-12-27
4
249 Views
Last Modified: 2013-01-03
I'm working in .NET Windows Application. In SQL we could use profiler to trace what are the SPs and TSQL commands are executed with respected values. Likewise, is there any tool to trace the .NET Windows application such as which method is being hit and what parameters has been passed to that? If so, please do share with me.

Any tool that make debugging easy in Windows application, please let me know.

Note: I'm using Visual Studio 2008.

Thanks in advance.
0
Comment
Question by:Easwaran Paramasivam
  • 2
4 Comments
 
LVL 8

Expert Comment

by:hpdvs2
ID: 38723569
Yes.  Its called instrumenting, or profiling, and it lets you see what calls are made and how much processing they took within a dll.  You do not see the variables though.

Here is an intro for instrumenting libraries/executables in VS 2008.

http://msdn.microsoft.com/en-us/magazine/cc337887.aspx


If you are interested in seeing variable values, the best way is with a debugger attached, so you can pause the application and check anything you want.
0
 
LVL 8

Accepted Solution

by:
hpdvs2 earned 150 total points
ID: 38723572
Typically an application has so much information going on, that you don't want to turn on Variable detail level recording for an an app in its entirety.  I strongly recommend setting break points or watches in your code.
0
 
LVL 40

Assisted Solution

by:Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger) earned 350 total points
ID: 38724402
Profiling does tell you the methods that were called, the number of times they were called and the time spend in each one, but it does not give you what you are requesting.

What you want is called tracing. There was not built-in mechanism to do that in Visual Studio 2008. One was introduced in 2010. It is called IntelliTrace, but unfortunately, it is available only in the costly Ultimate edition of Visual Studio. I have done a quick search, and there does not seem to be a third party or open source alternative, but a more comprehensive search might turn up something.

For simple tracing, you could use command similar to the following in the important place in your code:

Debug.WriteLine("Entering MethodName - param1=" + param1.ToString() + " - param2=" + param2.ToString());
'Method code
Debug.WriteLine("Exiting MethodName");

The result goes to the Output window by default, but can be redirected to a file (see the Listeners property of the Debug object). You can also use the Trace object in the same way, which would enable for instance to keep Debug for the Output Window and send Trace to a file.

The Debug and Trace objects are activated and deactivated for each configuration of your code through the Advanced Compile Options of the Compile tab of the project's properties window. You could thus have them active in the Debug version of your application, but deactivated for Release so that they not execute when run by the user even if they are in your source code.
0
 
LVL 16

Author Closing Comment

by:Easwaran Paramasivam
ID: 38740670
Thanks.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now