[Mono-list] How to build against NUnit?

"C. Bergström" cbergstrom at netsyncro.com
Tue Feb 20 20:17:13 EST 2007


Jason Perkins wrote:
> Apologies if this has been answered before -- I was able to find other
> people asking in the archives, but no one answering.
>
> I am trying to make the switch from MS .NET to Linux and Mono. I have
> created a simple project and a Makefile, all good. But I can't figure
> out how to add a reference to the NUnit assemblies. I thought adding
> `-r:nunit.framework.dll` would do it, but I get the "CS0006: Cannot
> find assembly" error.
>
> The nunit.framework assembly is in the GAC. I realize that you can't
> build against the GAC, but how should I set up my makefile so it will
> build against the right NUnit if I distribute my sources? Do I have to
> include a copy of NUnit in the source tree? Shouldn't this assembly be
> stored with all the other Mono assemblies so they can be referenced
> normally?
I'm not sure if it's the correct way to do it, but create an absolute 
reference to the path.

eg.. -r  
/usr/lib/mono/gac/nunit.core/2.2.0.0__96d09a1eb7f44a77/nunit.core.dll

Also. if you need 2.0 support you're going to have to go grab a more 
recent version of nunit from their download site.  I wish I had time to 
make a clean patch to update the nunit included with Mono..  Also.. 
doing so could break other commons apps like MD. log4net. etc..

I don't use nunit in any of my apps, but to the best of my knowledge if 
you're compiling against the version that comes bundled with mono.. you 
don't have to include anything else with your app.

Good luck

C.


More information about the Mono-list mailing list