This maybe silly, but instead of just giving a relative path to
bestbuy.enterprise.tests.dll, try giving it a fully qualified path including
the drive letter. This solved my problem. (See attached message.)

It already looks like you have part of the path, so all you need to do is
prefix it with your project path.

Lets say in your build script you have:

                <nunit2>
                        <test assemblyname="${BuildDir}\${TargetDll}" />
                </nunit2>

Change it to:

                <nunit2>
                        <test
assemblyname="${nant.project.basedir}\${BuildDir}\${TargetDll}" />
                </nunit2>

- Ants

| -----Original Message-----
| From: [EMAIL PROTECTED] 
| [mailto:[EMAIL PROTECTED] On Behalf Of 
| Wang, Gang
| Sent: Wednesday, 02 April, 2003 07:37
| To: Anthony Francisco
| Cc: [EMAIL PROTECTED]; 
| [EMAIL PROTECTED]
| Subject: RE: [nant-dev] [Nant-users] How to use nunit2 task (resend)
| 
| 
| Here's the error and call stack I'm getting. Please let me 
| know what might caused the problem. Thanks.
| 
| --------------------------------------------------------------
| -------------------
| INTERNAL ERROR
| System.IO.FileLoadException: Unable to load file 
| 'bestbuy.enterprise.tests'. File name: "bestbuy.enterprise.tests"
| 
| 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.PrivateProc
| essMessage(M
| ethodBase mb, Object[] args, Object server, Int32 methodPtr, 
| Boolean fExecuteInC ontext, Object[]& outArgs)
|    at 
| System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcess
| Message(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(Messag
| eData& 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(NUnit2T
| est 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 = bestbuy.enterprise.tests
|  (Partial)
| LOG: Appbase = build\bin\debug
| 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: bestbuy.enterprise.tests
| LOG: Attempting download of new URL 
| build\bin\debug/bestbuy.enterprise.tests.DLL
| .
| --------------------------------------------------------------
| ------------------
| 
| -----Original Message-----
| From: Anthony Francisco [mailto:[EMAIL PROTECTED]
| Sent: Tuesday, April 01, 2003 6:45 PM
| To: Wang, Gang; 'Matthew Mastracci'
| Cc: [EMAIL PROTECTED]; 
| [EMAIL PROTECTED]
| Subject: RE: [nant-dev] [Nant-users] How to use nunit2 task (resend)
| 
| 
| Hmmm, nunit.framework.dll was put into the GAC when I 
| installed Nunit. (Peeking at the .MSI file for Nunit, it 
| looks like it suppose to do that.) So unless you've been 
| cleaning stuff out of your GAC, this shouldn't have been a 
| problem. Anyway, you've solved that problem.
| 
| As you said, your new problem is that your test.dll cannot be 
| loaded. Can you paste in the error and callstack that you are 
| getting when your assembly fails to load ? This will probably 
| help other people on this list help you narrow down the issue.
| 
| - Ants
| 
| | -----Original Message-----
| | From: Wang, Gang [mailto:[EMAIL PROTECTED]
| | Sent: Tuesday, 01 April, 2003 14:23
| | To: Anthony Francisco; Matthew Mastracci
| | Cc: [EMAIL PROTECTED]; 
| | [EMAIL PROTECTED]
| | Subject: RE: [nant-dev] [Nant-users] How to use nunit2 task (resend)
| | 
| | 
| | Anthony, I got the same error yesterday when I tried to run
| | Nunit2 whithin NAnt. And I just found out that I need to put 
| | nunit.framework.dll in GAC of my machine in order for NAnt to 
| | load it. Now I got another error, which is my own test.DLL 
| | could not be loaded. Do I have to put my test.dll in GAC? I 
| | tried and failed. Could someone reply that they ever make 
| | nunit2 working whithin NAnt? Thanks.
| | 
| | Gang
| | 
| | -----Original Message-----
| | From: Anthony Francisco [mailto:[EMAIL PROTECTED]
| | Sent: Friday, March 28, 2003 1:58 PM
| | To: 'Matthew Mastracci'
| | Cc: [EMAIL PROTECTED];
| | [EMAIL PROTECTED]
| | Subject: RE: [nant-dev] [Nant-users] How to use nunit2 task (resend)
| | 
| | 
| | Actually that was the first thing that I checked.
| | 
| | The only file with the same filename that I could find
| | between my nant\bin and nunit\bin directories was 
| | nunit.framework.dll. Doing a binary file compare between the 
| | two files indicated a perfect match.
| | 
| | - Ants
| | 
| | | -----Original Message-----
| | | From: Matthew Mastracci [mailto:[EMAIL PROTECTED]
| | | Sent: Friday, 28 March, 2003 07:59
| | | To: Anthony Francisco
| | | Cc: [EMAIL PROTECTED];
| | | [EMAIL PROTECTED]
| | | Subject: Re: [nant-dev] [Nant-users] How to use nunit2 
| task (resend)
| | | 
| | | 
| | | Make sure that you're using the same version of NUnit for linking 
| | | your test assemblies that NAnt uses.  You'll get this error if
| | there is a
| | | mismatch.  I'm not sure what we can do to fix the issue of linking
| | | against the wrong NUnit, but I'm guessing that this is what 
| | | the problem is.
| | | 
| | | Anthony Francisco wrote:
| | | 
| | | > I getting a crash in NAnt when trying to use the nunit2 task.
| | | >  
| | | > I tried using the nunit2 task using the following in my
| | | build script:
| | | >  
| | | >  <target name="test" depends="build" description="Runs
| | NUnit tests">
| | | >   <nunit2>
| | | >    <test assemblyname="Reveal.exe" />
| | | >   </nunit2>
| | | >  </target>
| | | > The result I get is:
| | | > INTERNAL ERROR
| | | > System.IO.FileLoadException: Unable to load file
| | 'nunit.framework'.
| | | > File name: "nunit.framework"
| | | >  
| | | > 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.PrivateProc
| | | essMessage(M
| | | > ethodBase mb, Object[] args, Object server, Int32
| | | methodPtr, Boolean
| | | > fExecuteInC
| | | > ontext, Object[]& outArgs)
| | | >    at
| | | > 
| | | System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcess
| | | Message(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(Messag
| | | eData& 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
| | | > 
| | | SourceForge.NAnt.Tasks.NUnit2.NUnit2TestDomain.CreateTestRunne
| | | r(AppDomain
| | | > domain)
| | | >    at SourceForge.NAnt.Tasks.NUnit2.NUnit2TestDomain.Run(String
| | | > assemblyFile, St
| | | > ring configFilePath, EventListener listener)
| | | >    at
| | | > 
| | | SourceForge.NAnt.Tasks.NUnit2.NUnit2Task.RunRemoteTest(NUnit2T
| | | est 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:
| | | >  
| | | > Please send bug report to [EMAIL PROTECTED]
| | | > <mailto:[EMAIL PROTECTED]>
| | | > Try 'nant -help' for more information
| | | > I can run nunit-console just fine from the 
| command-line, but NAnt 
| | | > seems unable to be crashing.
| | | >  
| | | > Is there anything special I need to do to my NT CMD shell ?
| | | >  
| | | > - Ants
| | | 
| | | 
| | 
| | 
| | 
| | -------------------------------------------------------
| | This SF.net email is sponsored by:
| | The Definitive IT and Networking Event. Be There!
| | NetWorld+Interop Las Vegas 2003 -- Register today!
| | http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
| | _______________________________________________
| | Nant-users mailing list
| | [EMAIL PROTECTED]
| | https://lists.sourceforge.net/lists/listinfo/n| ant-users
| | 
| 
| 
| 
| 
| 
| -------------------------------------------------------
| This SF.net email is sponsored by: ValueWeb: 
| Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
| No other company gives more support or power for your dedicated server
| http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
| _______________________________________________
| Nant-users mailing list
| [EMAIL PROTECTED]
| https://lists.sourceforge.net/lists/listinfo/nant-users
| 
--- Begin Message ---
Title: RE: [nant-dev] [Nant-users] How to use nunit2 task (resend)

Thank you Arnaud!

You're suggestion didn't fix my problem, but it did help me determine the source of the problem.

The assemblyname property of the test element wants a full path. It doesn't like relative paths.

- Ants

| -----Original Message-----
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED]] On Behalf Of
| Anthony Francisco
| Sent: Friday, 28 March, 2003 15:19
| To: 'Arnaud PICHERY'
| Cc: [EMAIL PROTECTED]
| Subject: RE: [nant-dev] [Nant-users] How to use nunit2 task (resend)
|
|
| Yup, I tried that as my first attempt to solve the problem. I
| wasn't as fortunate as you were. :-(
|
| - Ants
|
| | -----Original Message-----
| | From: Arnaud PICHERY [mailto:[EMAIL PROTECTED]]
| | Sent: Friday, 28 March, 2003 15:11
| | To: 'Anthony Francisco'
| | Cc: [EMAIL PROTECTED]
| | Subject: RE: [nant-dev] [Nant-users] How to use nunit2 task (resend)
| |
| |
| | I have encountered the same problem and solved it by copying
| | the nunit.framework.dll Assembly from the nant directory to
| | the directory where my assembly containing the test cases resides.
| |
| | Here are extracts from my build file:
| |
| | <script language="C#">
| |     <code><![CDATA[
| |             public static void ScriptMain(Project project) {
| |                     project.Properties.Add("nant.dir", new
| | System.IO.FileInfo(new
| | System.Uri(project.Properties["nant.filename"]).LocalPath).Dir
| | ectory.Ful
| | lName);
| |             }
| |     ]]></code>
| | </script>
| | ...
| | <copy file="${nant.dir}\nunit.framework.dll"
| | todir="${build.dir}"/> ... <nunit2>
| |     <test assemblyname="${build.dir}\Systar.SAF.Web.UnitTests.dll"
| | />
| | </nunit2>
| | ...
| |
| |
| | Hope this helps,
| | Arnaud :O)
| |
|
|
|
| -------------------------------------------------------
| This SF.net email is sponsored by:
| The Definitive IT and Networking Event. Be There!
| NetWorld+Interop Las Vegas 2003 -- Register today!
| http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
| _______________________________________________
| Nant-users mailing list
| [EMAIL PROTECTED]
| https://lists.sourceforge.net/lists/listinfo/n| ant-users
|


--- End Message ---

Reply via email to