I am trying NAnt and NUnit for the first time. Can some one please help me out? THis is the error I am getting. The build file is given below.
Simple HelloWorld Testing.
C:\OEMS\dev\nant>bd clean build test Starting Build... Buildfile: file:///C:/OEMS/dev/nant/oems.build
clean: [delete] Deleting file C:\OEMS\dev\src\..\bin\HelloWorld.dll [delete] Deleting file C:\OEMS\dev\src\..\bin\HelloWorldTest.dll [delete] Deleting file C:\OEMS\dev\src\..\bin\HelloWorld.pdb
build: [csc] Compiling 1 files to C:\OEMS\dev\bin\HelloWorld.dll
test: [csc] Compiling 1 files to C:\OEMS\dev\bin\HelloWorldTest.dll
INTERNAL ERROR System.IO.FileLoadException: Unable to load file 'HelloWorldTest'. File name: "HelloWorldTest"
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.AppDomain.Load(String assemblyString)
at NUnit.Core.TestSuiteBuilder.Build(String assemblyName)
at NUnit.Core.RemoteTestRunner.BuildSuite()
at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
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.DoCallBack(CrossAppDomainDelegate callBackDelegate)
at SourceForge.NAnt.Tasks.NUnit2.NUnit2TestDomain.Run(String assemblyFile, St
ring configFilePath, EventListener listener)
at SourceForge.NAnt.Tasks.NUnit2.NUnit2Task.RunRemoteTest(NUnit2Test test, Ev
entListener listener)
at SourceForge.NAnt.Tasks.NUnit2.NUnit2Task.ExecuteTask()
at SourceForge.NAnt.Task.Execute()
at SourceForge.NAnt.Target.Execute()
at SourceForge.NAnt.Project.Execute(String targetName)
at SourceForge.NAnt.Project.Execute()
at SourceForge.NAnt.Project.Run()
Fusion log follows:
=== Pre-bind state information ===
LOG: DisplayName = HelloWorldTest
(Partial)
LOG: Appbase = ..\bin
LOG: Initial PrivatePath = NULL
Calling assembly : nunit.framework, Version=2.0.6.0, Culture=neutral, PublicKeyT
oken=96d09a1eb7f44a77.
===
LOG: Policy not being applied to reference at this time (private, custom, partia
l, or location-based assembly bind).
LOG: Post-policy reference: HelloWorldTest
LOG: Attempting download of new URL ..\bin/HelloWorldTest.DLL.
Please send bug report to [EMAIL PROTECTED] Try 'nant -help' for more informationcom
---------------- Build File
<?xml version="1.0"?>
<project name="Hello World" default="build" basedir="..\src"> <description>The Hello World of build files.</description> <property name="debug" value="true"/>
<property name="build_dir" value="..\bin"/> <property name="nunit_dir" value="..\tools\nunit\bin"/> <target name="clean" description="remove all generated files"> <delete file="${build_dir}\HelloWorld.dll" failonerror="false"/> <delete file="${build_dir}\HelloWorldTest.dll" failonerror="false"/> <delete file="${build_dir}\HelloWorld.pdb" failonerror="false"/> </target>
<target name="build" description="compiles the source code">
<mkdir dir="${build_dir}" />
<csc target="library" output="${build_dir}\HelloWorld.dll" debug="${debug}">
<sources> <includes name="HelloWorld.cs"/> </sources> </csc>
</target>
<target name="test" depends="build">
<csc target="library" output="${build_dir}\HelloWorldTest.dll" debug="${debug}">
<sources>
<includes name="HelloWorldTest.cs"/>
</sources>
<references>
<includes name="${nunit_dir}\nunit.framework.dll" />
<includes name="${build_dir}\HelloWorld.dll" />
</references>
</csc>
<nunit2>
<test assemblyname="${build_dir}\HelloWorldTest.dll" outfile="results.xml" />
</nunit2>
</target>
</project>
--------------- Source and test driver
namespace Hello {
using System;
public class HelloWorld {
private String str = "";
public HelloWorld() { str = "Hello World"; }
public String getStr() { return str; } } }
namespace Hello { using NUnit.Framework; using System;
[TestFixture] public class HelloWorldTest {
public HelloWorldTest(){} [Test] public void getStr() { HelloWorld hello = new HelloWorld(); Assertion.AssertEquals("Hello World", hello.getStr()); } } }
Thanks a lot.
Anand
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
------------------------------------------------------- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users