3

I have a rather large C# library, originally written for .NET and Windows, which we are now porting to Mono and Linux. It is thoroughly unit tested with NUnit. The porting has been fairly simple, but now I need some real debugging features, like error line numbers and breakpoints.

I'm compiling either using VS2010 on Windows 7 or with xbuild on Debian 6.0.2, it really doesn't matter because the binaries are fully compatible. Running tests with Mono 2.10.2 built from tarball, and NUnit 2.5.10 from Debian experimental.

When I run my project in Visual Studio, debugging works fine after I attach to the nunit process. So, does anyone know how I can enable fully-featured Mono debugger support with NUnit tests?

P.S. I've seen this, but I'm compiling with xbuild and running with nunit-console, so I can't manually give arguments to either the compiler or the Mono runtime.

Thanks in advance!

UPDATE: I discovered the pdb2mdb utility, but even when I use this, I still can't get line numbers, which leads me to believe that the code isn't being compiled with --debug. But since I'm using xbuild on a VS .sln file, instead of invoking the compiler directly, how do I use --debug??

2
  • Hey, did you ever figure out how to get line numbers? Commented Mar 28, 2014 at 16:50
  • @wallacer Nope. We've since switched to using a Jenkins plugin to handle basically everything. It isn't my primary responsibility anymore, but out failure output still has a bunch of "<filename unknown>:0". Sorry. Commented Apr 17, 2014 at 19:02

1 Answer 1

4

Figured it out. Jon Skeet comes to the rescue, once again:

Nunit .net vs mono

After converting to mdb, I needed to run nunit-console.EXE from inside the mono command, like this:

mono --debug /opt/mono-2.10/lib/mono/4.0/nunit-console.exe Test.dll -config=Debug

That took way longer than it should have :P

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.