Trying to get debugging output from Mono NUnit tests
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?
PS 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??
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
链接地址: http://www.djcxy.com/p/52216.html上一篇: MONO:将.net移植到Linux。