Hi

I didn't get a reply to this question on nant-users.
I want my nant script to run NUnit (<nunit2>) under .Net 3.5 - it runs
everything else (eg <msbuild>) correctly when I specify a target framework
of net-3.5.
But NUnit seems to be run as .Net 4 and consequently I get the following
errors:

   [nunit2] Test Fixture SetUp Failures:
   [nunit2] 1) AlerterTests : SetUp : System.IO.FileLoadException : Mixed
mode assembly is built against version 'v2.0.50727' of the runtime and
cannot be loaded in the 4.0 run...
   [nunit2] at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly
assembly, String name, Boolean throwOnError, Boolean ignoreCase,
ObjectHandleOnStack type)
   [nunit2] at System.Reflection.RuntimeAssembly.GetType(String name,
Boolean throwOnError, Boolean ignoreCase)
   [nunit2] at System.Reflection.Assembly.GetType(String name, Boolean
throwOnError)
   [nunit2] at
Microsoft.SqlServer.Management.Common.ServerConnection.GetStatements(String
query, ExecutionTypes executionType, Int32& statementsToReverse)
   [nunit2] at
Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String
sqlCommand, ExecutionTypes executionType)


I still get this problem with 0.92rc1. What can I do about it?
Is this because <msbuild> is run as a different process, whereas <nunit2>
is run in the same process as Nant?


Thanks,
Richard

---------- Forwarded message ----------
From: Richard Birkby <rbir...@gmail.com>
Date: Mon, Oct 24, 2011 at 9:51 AM
Subject: CLR4/CLR2 NUnit binding
To: nant-us...@lists.sourceforge.net


Hi,

I've tried to upgrade our Nant 0.90 to Nant 0.91 this morning. Everything
went well apart from the test phase where NUnit failed with errors such as:

 : System.IO.FileLoadException : Mixed mode assembly is built against
version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime
without additional configuration information.

It appears from ildasm that Nant correctly built my assemblies against .Net
3.5, however when it starts running the nunit2 task, it thinks it should
run it as .Net 4.

What should I do to tell it to run it as .Net 3.5?


Thanks,
Richard
ps There is a small possibility I corrupted the merge of Nant 0.91 into the
existing structure. Could this be the reason?
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to