Fwd: CLR4/CLR2 NUnit binding
Richard Birkby <[email protected]> Fri, 1 Jun 2012 11:16:34 +0100
| Newsgroups | gmane.comp.windows.dotnet.nant.devel |
|---|---|
| Message-ID | <CAO+Vd0jCStoTbH7kky1R6OQBkaoBtnVukH9G1Lc-3C=3i3roBQ@mail.gmail.com> |
--===============5511429519270382275== Content-Type: multipart/alternative; boundary=bcaec54314649d10d204c1667a06 --bcaec54314649d10d204c1667a06 Content-Type: text/plain; charset=ISO-8859-1 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 <[email protected]> Date: Mon, Oct 24, 2011 at 9:51 AM Subject: CLR4/CLR2 NUnit binding To: [email protected] 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? --bcaec54314649d10d204c1667a06 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi<div><br></div><div>I didn't get a reply to this question on nant-use= rs.=A0</div><div>I want my nant script to run NUnit (<nunit2>) under = .Net 3.5 - it runs everything else (eg <msbuild>) correctly when I sp= ecify a target framework of net-3.5.</div> <div>But NUnit seems to be run as .Net 4 and consequently I get the followi= ng errors:</div><div><br></div><div><div>=A0 =A0[nunit2] Test Fixture SetUp= Failures:</div><div>=A0 =A0[nunit2] 1) AlerterTests : SetUp : System.IO.Fi= leLoadException : Mixed mode assembly is built against version 'v2.0.50= 727' of the runtime and cannot be loaded in the 4.0 run...</div> <div>=A0 =A0[nunit2] at System.Reflection.RuntimeAssembly.GetType(RuntimeAs= sembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, Obj= ectHandleOnStack type)</div><div>=A0 =A0[nunit2] at System.Reflection.Runti= meAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)</= div> <div>=A0 =A0[nunit2] at System.Reflection.Assembly.GetType(String name, Boo= lean throwOnError)</div><div>=A0 =A0[nunit2] at Microsoft.SqlServer.Managem= ent.Common.ServerConnection.GetStatements(String query, ExecutionTypes exec= utionType, Int32& statementsToReverse)</div> <div>=A0 =A0[nunit2] at Microsoft.SqlServer.Management.Common.ServerConnect= ion.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)</div><= /div><div><br></div><div><br></div><div>I still get this problem with 0.92r= c1. What can I do about it?<br> Is this because <msbuild> is run as a different process, whereas <= nunit2> is run in the same process as Nant?<br><br><br>Thanks,</div><div= >Richard<br><br><div class=3D"gmail_quote">---------- Forwarded message ---= -------<br> From: <b class=3D"gmail_sendername">Richard Birkby</b> <span dir=3D"ltr">&l= t;<a href=3D"mailto:[email protected]">[email protected]</a>></span><br>= Date: Mon, Oct 24, 2011 at 9:51 AM<br>Subject: CLR4/CLR2 NUnit binding<br>T= o: <a href=3D"mailto:[email protected]">[email protected]= rceforge.net</a><br> <br><br>Hi,<div><br></div><div>I've tried to upgrade our Nant 0.90 to N= ant 0.91 this morning. Everything went well apart from the test phase where= NUnit failed with errors such as:</div><div><br></div><div><div>=A0: Syste= m.IO.FileLoadException : Mixed mode assembly=A0<span style=3D"background-co= lor:transparent">is built against version 'v2.0.50727' of the runti= me and cannot be loaded in the</span><span style=3D"background-color:transp= arent">=A04.0 runtime without additional configuration information.</span><= /div> </div><div><br></div><div>It appears from ildasm that Nant correctly built = my assemblies against .Net 3.5, however when it starts running the nunit2 t= ask, it thinks it should run it as .Net 4.</div><div><br></div><div>What sh= ould I do to tell it to run it as .Net 3.5?</div> <div><br></div><div><br></div><div>Thanks,</div><div>Richard</div><div>ps T= here is a small possibility I corrupted the merge of Nant 0.91 into the exi= sting structure. Could this be the reason?</div><div><br></div> </div><br></div> --bcaec54314649d10d204c1667a06-- --===============5511429519270382275== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ 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/ --===============5511429519270382275== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ nant-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nant-developers --===============5511429519270382275==--