Slow debugging of MbUnit tests with Gallio and TD.NET

March 18, 2009 at 12:04 PMAndre Loker

No, this is not another rant about the troubles I’m having migrating to Gallio, so don’t be alarmed :-) In fact, the Gallio people have proven to be really bothered about the issues I have (see previous post and especially the comments). Thanks a lot for your commitment!

Sometimes I need to debug unit tests to see why they fail. TestDriven.NET has a nice feature that allows just that.


This has always worked perfectly smooth with MbUnit 2.4 when using Gallio ( with MbUnit the execution during debugging was very sluggish. This problem has been reported in the mailing list.

One workaround was posted on the thread mentioned above: disable the “property evaluation and other implicit function calls” option in the Visual Studio debugging options.


Doing this reverted the debugging experience to normal speed. The only drawback is that you need to “manually” refresh the values of properties by clicking on the two green arrows on the right side.


This is not the most convenient thing in the world, but I hope that it’s just a temporary state of affairs that the Gallio folks are able to fix soon.

Posted in: Tools

Tags: , ,

Comments (7) -

I am glad that you are bringing some of these minor nuisances to light.  I was at first very excited to see that MbUnit 3 was coming out but so far I have wished that they had just done a version 2.6 or something.

After having played with this workaround I come to the conclusion that it is not something I'm going to live with. Debugging without property evaluation is quite cumbersome. I'm afraid that after moving back and forth over the last weeks I'll have to revert to 2.4.

Ah ha!

I turn off implicit property evaluation all of the time because it slows down the debugging experience so much (with or without Gallio).  Also, evaluating properties sometimes has undesirable side-effects.

However it sounds like somehow when running the tests under Gallio the problem is worse than before.  Have you measured the difference?  One test single-step 10 times under MbUnit v3 vs. same thing under MbUnit v2?

So the problem appears to be the depth of the stack trace when the test runs.  I'll see what I can do about this in v3.0.7.

I too am seeing this and it is driving me nuts.  Probably the biggest unit testing crutch I have is TD.NET and MbUnit Rollback and now I have to fall back to NUnit and Roy's old Rollback attribute.

Thanks for the indepth look into the problem as it did save me some time.

I have spent some time optimizing MbUnit v3's stack depth so that it is much more debugger friendly.  On my machine I have seen a noticeable reduction in the amount of time it takes to single-step in the debugger.

What I would like is for those of you who were experiencing poor debugging performance to try out Gallio v3.1 build 258 or newer.

Please let me know if this has resolved the debugger performance issues for you.



Hmm.  I posted a comment yesterday but it did not appear on the site.

Anyways, I have spent some time optimizing MbUnit v3.1 to be more debugger friendly.  I have received positive feedback that single-stepping performance is much better (iirc, the word used was "instantaneous").  Smile

Pingbacks and trackbacks (3)+