Hi Jaroslaw Here is my 2 €cent. Shoot me if I got it wrong Versionning for 1.0 & 1.1 is basically this: An executable tries to run within it's own runtime.
so Nunit (compiled on 1.0) tries to run a some library of test compiled on 1.0 -> nunit tries to loads someting from mscorlib (1.0 version) & it runs fine. Then you try to run Nunit (compiled on 1.0) & run some library of test compiled on (1.1). Thus following the basic rule; nant (& nunit) loads classes from mscorlib (.Net 1.0) & everything is running under runtime 1.0. Then your tests ask for mscorlib ( .Net version 1.1) and then Bang. There is no way for the runtime to know what it should do here. You just got a dependency problem here. By default the runtime won't allow something compile on 1.0 to run under 1.1 So, when you use <startup> <supportedRuntime version="v1.1.4322" /> <supportedRuntime version="v1.0.3705" /> </startup> Your basically saying to the runtime try to run everything under version 1.1 of the .net framework. & then it works fine because nant(& nunit) are then running under the 1.1 version of the runtime. Hope this helps (& accurate enough) Yves ________________________________ From: Jaroslaw Kowalski [mailto:[EMAIL PROTECTED] Sent: lundi 2 juin 2003 15:40 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] I have an application that I compile for both net-1.0 and net-1.1. For my unit tests I'm linking to binary NUnit.Framework.dll that is provided by NAnt (as in the following snippet) -------------- <copy file="${nant.location}/NUnit.Framework.dll" tofile="${outdir}/NUnit.Framework.dll" /> <csc ...> <references> <includes name="${outdir}/NUnit.Framework.dll" /> </references> </csc> ---------- One of my tests relies on ConfigurationSettings.AppSettings[] to get some configuration. When I compile it on net-1.1 and run <nunit2> on it I get this strange error when getting some setting. Error loading XML file c:\winnt\microsoft.net\framework\v1.0.3705\Config\machine.config Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed. (c:\winnt\microsoft.net\framework\v1.0.3705\Config\machine.config) When the DLL is compiled for net-1.0, the test runs just fine. Digging through the internet I've found a solution: I had to swap the two <supportedRuntime> lines in nant.exe.config file, so that v1.1.4322 is before v1.0.3705: ------------------------------------------ <startup> <supportedRuntime version="v1.1.4322" /> <supportedRuntime version="v1.0.3705" /> </startup> ------------------------------------------ Now the tests compiled with net-1.0 and net-1.1 run just fine (which is big a surprise to me as I don't understand this behaviour) Is it a bug in NAnt or NUnit - or maybe a Microsoft general versioning problem? Can some MS guru explain this behaviour? Maybe an option is needed that will force <nunit2> to run under specified runtime? Maybe it should make use of nant.settings.currentframework? Jarek BTW. NUnit-console.exe and nunit-gui.exe themselves have similar problems. I had to modify <startup> section to make it run under net-1.1. ------------------------------------------------------- This SF.net email is sponsored by: eBay Get office equipment for less on eBay! http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users