----- Original Message ----- From: "Ayende Rahien" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 09, 2004 6:07 AM
Subject: [nant-dev] NAnt & Nunit 2
I'm trying to run a simple test script and I get an error: Anyone can help me? I added the following to Nant.exe.config
<nant taskpath=".\optional"> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly>
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
<bindingRedirect oldVersion="2.0.6.0" newVersion="2.1.4.0" /> </dependentAssembly> </assemblyBinding> </runtime> <.>
As I said in my previous mail: you need to add this to the application configuration file of your test assembly.
The error is below (and I got Nunit.framework 2.1.4 referenced from the test
case as well as in the same directory as Nant.exe
D:\Code Tools\Boar\Build>nant Run.Tests NAnt 0.84 (Build 0.84.1455.0; net-1.0.win32; release; 26/12/2003) Copyright (C) 2001-2003 Gerry Shaw http://nant.sourceforge.net
Buildfile: file:///D:/Code Tools/Boar/Build/Boar.Build Target(s) specified: Run.Tests
Prepare:
Compile:
Compile.Tests:
Run.Tests:
[Core.Task:nunit2 Generated Exception - [] <>] Exception: NAnt.Core.BuildException Message: NUnit 2.0 Error: Source: NAnt.NUnit2Tasks at NAnt.NUnit2.Tasks.NUnit2Task.RunSingleRemoteTest(NUnit2Test test, String t estAssembly, EventListener listener) at NAnt.NUnit2.Tasks.NUnit2Task.RunRemoteTest(NUnit2Test test, EventListener listener) at NAnt.NUnit2.Tasks.NUnit2Task.ExecuteTask() at NAnt.Core.Task.Execute()
Nested Exception
Exception: System.IO.FileNotFoundException
Message: File or assembly name nunit.framework, or one of its dependencies,
was
not found.
Source: mscorlib
Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, B
oolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound,
Ass
embly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean
stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence as
semblySecurity, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName,
Bool
ean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureI
nfo culture, Object[] activationAttributes, Evidence securityInfo,
StackCrawlMar
k& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName,
Bool
ean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureI
nfo culture, Object[] activationAttributes, Evidence securityInfo)
at System.AppDomain.CreateInstance(String assemblyName, String typeName,
Bool
ean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureI
nfo culture, Object[] activationAttributes, Evidence securityAttributes)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(M
ethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInC
ontext, Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMes
sage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgDa
ta, Int32 type)
at System.AppDomain.CreateInstance(String assemblyName, String typeName,
Bool
ean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureI
nfo culture, Object[] activationAttributes, Evidence securityAttributes)
at NAnt.NUnit2.Tasks.NUnit2TestDomain.CreateTestRunner(AppDomain domain)
at NAnt.NUnit2.Tasks.NUnit2TestDomain.RunTest(String testcase, String
assembl
yFile, String configFilePath, EventListener listener)
at NAnt.NUnit2.Tasks.NUnit2Task.RunSingleRemoteTest(NUnit2Test test,
String t
estAssembly, EventListener listener)
[Core.Project:Build failed. - [] <>] Exception: NAnt.Core.BuildException Message: NUnit 2.0 Error: Source: NAnt.NUnit2Tasks at NAnt.NUnit2.Tasks.NUnit2Task.RunSingleRemoteTest(NUnit2Test test, String t estAssembly, EventListener listener) at NAnt.NUnit2.Tasks.NUnit2Task.RunRemoteTest(NUnit2Test test, EventListener listener) at NAnt.NUnit2.Tasks.NUnit2Task.ExecuteTask() at NAnt.Core.Task.Execute() at NAnt.Core.Target.Execute() at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies) at NAnt.Core.Project.Execute() at NAnt.Core.Project.Run()
Nested Exception
Exception: System.IO.FileNotFoundException
Message: File or assembly name nunit.framework, or one of its dependencies,
was
not found.
Source: mscorlib
Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, B
oolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound,
Ass
embly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean
stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence as
semblySecurity, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName,
Bool
ean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureI
nfo culture, Object[] activationAttributes, Evidence securityInfo,
StackCrawlMar
k& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName,
Bool
ean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureI
nfo culture, Object[] activationAttributes, Evidence securityInfo)
at System.AppDomain.CreateInstance(String assemblyName, String typeName,
Bool
ean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureI
nfo culture, Object[] activationAttributes, Evidence securityAttributes)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(M
ethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInC
ontext, Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMes
sage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgDa
ta, Int32 type)
at System.AppDomain.CreateInstance(String assemblyName, String typeName,
Bool
ean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureI
nfo culture, Object[] activationAttributes, Evidence securityAttributes)
at NAnt.NUnit2.Tasks.NUnit2TestDomain.CreateTestRunner(AppDomain domain)
at NAnt.NUnit2.Tasks.NUnit2TestDomain.RunTest(String testcase, String
assembl
yFile, String configFilePath, EventListener listener)
at NAnt.NUnit2.Tasks.NUnit2Task.RunSingleRemoteTest(NUnit2Test test,
String t
estAssembly, EventListener listener)
BUILD FAILED
NUnit 2.0 Error: File or assembly name nunit.framework, or one of its dependencies, was not foun d.
Total time: 0.3 seconds.
This also was an issue with NAnt 0.84. I suggest upgrading to a recent nightly build of NAnt 0.85 (http://nant.sourceforge.net/nightly/builds).
Note: NAnt 0.85 uses NUnit 2.2, so the value of the "newVersion" attribute should be "2.2.0.0".
Gert
------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers
