Reputation: 301
how can I trace code execution of my C# application? Are there any tools available? I have an issue in my production site.
Upvotes: 3
Views: 8894
Reputation: 4110
To trace production Issues the best option is ETW tracing. Especially in ASP.NET there are built-in providers which can help identify the Perf Issues.
And if you are using Window2008 then the ETW traces can give call-stacks. There are ETW tracing from IIS, FileSystem , Registry , Threading and everything possible. Here is an MSDN article on this and to get Managed call-stacks I have few posts
Upvotes: 0
Reputation: 498972
There is a built in tool in visual studio called a debugger.
You set a breakpoint in your code and step through.
The .NET framework also provides tracing classes in the System.Diagnostics namespace.
For a running application that has no code support for tracing, you may be able to use a profiler (such as the redgate ANTZ profiler or the JetBrains dotTrace), but this will impact performance.
If you have a memory dump (either from a crash or an manually induced one), you can use windbg to analyse the dump. This will include trace information.
Upvotes: 9
Reputation: 6608
Visual studio has great debugging tool however if that too terned out to be not sufficient then you can start with static code analysis tools which are helpful to analyze the code branches.
Upvotes: 0
Reputation: 12423
In Visual Studio 2005+ press F11 instead of F5 to run the application.
Or you can insert a breakpoint (clicking to the left of the line where you want to break so that VS shows a red dot).
Upvotes: 0