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??

Community
  • 1
  • 1
ACK_stoverflow
  • 3,148
  • 4
  • 24
  • 32
  • Hey, did you ever figure out how to get line numbers? – wallacer Mar 28 '14 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 ":0". Sorry. – ACK_stoverflow Apr 17 '14 at 19:02

1 Answers1

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

Community
  • 1
  • 1
ACK_stoverflow
  • 3,148
  • 4
  • 24
  • 32