[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Tracing Tools for .NET Windows Application

Posted on 2012-12-27
4
Medium Priority
?
269 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 450 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 1050 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

649 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