Paul,

The <nunit2> task uses the NUnit API to run the tests. As a result, the unit
tests are executed in the CLR that is hosting NAnt.

I will soon add an <nunit-console> task that will run the nunit-console.exe
that corresponds with the target framework.

Gert

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:nant-
> [EMAIL PROTECTED] On Behalf Of Paul Miles
> Sent: maandag 30 oktober 2006 16:13
> To: nant-developers@lists.sourceforge.net
> Subject: [nant-dev] NAnt using wrong DLL - possible bug?
> 
> Hello,
> 
> I have a unit test which passes when using NUnit 2.2.6 directly
> (command line or GUI) but fails when running with Nant. I believe that
> I have found a bug where NAnt uses the a version of a DLL for a
> different framework version, but I want a second opinion before
> reporting a bug.
> 
> The computer has the following frameworks installed:
> * 1.0.3705
> * 1.1.4322
> * 2.0.50727
> 
> The desired framework is 1.1.4322. We are using Visual Studio 2003 for
> this particular project.
> 
> The Unit Test (see below) correctly throws a FileNotFoundException
> when running with NUnit directly, but throws a
> System.TypeLoadException when running the test with NAnt which causes
> the test (and subseqently the build) to fail.
> 
> The Type class is located in the mscorlib.dll. Using Process Explorer
> I've discovered that NUnit is using the DLL located at:
>       C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll
> and NAnt is using the DLL located at:
>       C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\bbfd2fbe0
> 872e74abd524b4fa3333b0a\mscorlib.ni.dll
> 
> Has anyone else with multiple frameworks installed encountered this
> issue. Is there some other NAnt setting that I missed (see build file
> below) or any other recommendations? Should I report a bug?
> 
> Thanks!
> 
> UNIT TEST
> =========
> [Test()]
> [ExpectedException( typeof( FileNotFoundException ), "File or assembly
> name System, or one of its dependencies, was not found." )]
> public void Paul()
> {
>       Type.GetType( "System.NotAnObject, System", true );
> }
> 
> 
> BUILD FILE
> ==========
> <?xml version="1.0" ?>
> <project name="InventoryDriverSolution" default="test"
>       xmlns="http://nant.sf.net/release/0.85/nant.xsd";>
> 
>       <property name="solution.dir" value="${project::get-base-
> directory()}" />
>       <property name="nant.settings.currentframework" value="net-1.1"/>
> 
>       <target name="clean">
>               <delete dir="${build.dir}"/>
>       </target>
> 
>       <target name="build">
>               <solution configuration="debug"
>                       solutionfile="${solution.dir}\ClassLibrary1.sln"
>                       outputdir="build\debug">
>               </solution>
>       </target>
> 
>       <target name="test" depends="build">
>               <nunit2 verbose="true">
>                       <formatter type="Plain"/>
>                       <test assemblyname="build\debug\ClassLibrary1.dll"
/>
>               </nunit2>
>       </target>
> </project>
> 
> -----------------------------------------------------------------------
> --
> Using Tomcat but need to do more? Need to support web services,
> security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-
> us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> nant-developers mailing list
> nant-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nant-developers


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to