Solved

Tracing Tools for .NET Windows Application

Posted on 2012-12-27
4
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Graph API & MS Apps 1 57
Get sourcecode path 14 47
WPF Select Items 3 27
Set arraylist as datatable 2 10
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
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…

733 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