tags:

views:

101

answers:

6

I'm debugging into the .NET Framework source code to look for a bug in my application. I have two similar inputs for the code where one exhibits the bug and the other doesn't. However to follow the code path into the .NET source is quite complex.

What I'd like is a tool that can be executed for both inputs and compare the results to see what code paths are taken, how the internal values differ, etc...

Is this available for .NET?

+3  A: 

You could try nCover. It can show you code coverage information which might help you work out which branches are taken when the bug occurs.

Mark Byers
@Mark: Just trying that out but it doesn't seem to pick up the .NET Framework source. I need to be able to see what MS's code is doing. Unless I'm missing an option?
Alex Angas
A: 

You could try JetBrains DotTrace and just ignore the timings. They offer a free 30 day trial download.

Winston Smith
A: 

As Mitch suggests, check out a profiler, perhaps ANTS. It will give you all the method calls so you can see everything that is going on.

Noon Silk
A: 

The SD C# Test Coverage Tool will show you what code is executed if you run your test cases separately.

It will also compute the difference between the covered code for each case if you ask it to do so. This difference will be the code that one tests executes, that the other does not. Likely that's where your problem is.

It won't help you obtain source for the .NET framework.

Ira Baxter
A: 

Try using a profiler:

If you have the Enterprise version of Visual Studio 2008 (or other version)

Mitch Wheat
A: 

Try the free EQATEC Tracer - it does pretty much exactly what you're looking for.

It injects "tracing-code" into your application which will at runtime tell you exactly what methods are executed and what the parameters are. There are sophisticated ways of fine-tuning what methods to trace, since "all" is usually too much, but you can turn on tracing for all methods with just one single click if you really want to.

Take a look at the key features here: http://www.eqatec.com/tools/tracer/features

-and get it here: http://www.eqatec.com/tools/tracer

Edit: Sorry, I missed the part about having to dig into the actual .NET framework code. The tracer can't do that in an easy manner.

Richard Flamsholt