Re: Fwd: CLR4/CLR2 NUnit binding

Richard Birkby <[email protected]> Fri, 1 Jun 2012 16:34:34 +0100
Newsgroups gmane.comp.windows.dotnet.nant.devel
Message-ID <CAO+Vd0gvHdG9rLH_4D_Q1To2SFGA5dG1AfROQ0CmrPgvAta_Bg@mail.gmail.com>
--===============1022635103975215570==
Content-Type: multipart/alternative; boundary=bcaec5431464dc636704c16aebb5

--bcaec5431464dc636704c16aebb5
Content-Type: text/plain; charset=ISO-8859-1

Yes, thanks - that confirms what I had thought.


Richard

On Fri, Jun 1, 2012 at 3:29 PM, Ryan Boggs <[email protected]> wrote:

> Hi,
>
> That's because the nunit2 is running on the framework that NAnt is
> currently running on.  Which is the highest version of the .NET
> framework found on your machine.  I see that you have two options.
>
> 1) Compile your project on 4.0
> or
> 2) If you must compile your project on 3.5, then you could edit the
> NAnt.exe.config to not run on 4.0 by removing/commenting out the
> element listed below at the bottom of the file.  Please be advised
> that this may also have unforeseen side-effects when running NAnt.
> Thus, I do not recommend this course of action.
>
> Xml Element to delete/comment in NAnt.exe.config:
> <supportedRuntime version="v4.0.30319" />
>
> Hope this info is helpful.
>
> Thanks,
> Ryan
>
> On Fri, Jun 1, 2012 at 3:16 AM, Richard Birkby <[email protected]> wrote:
> > 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?
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > 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
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/nant-developers
> >
>

--bcaec5431464dc636704c16aebb5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Yes, thanks - that confirms what I had thought.<div><br></div><div><br></di=
v><div>Richard<br><br><div class=3D"gmail_quote">On Fri, Jun 1, 2012 at 3:2=
9 PM, Ryan Boggs <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]"=
 target=3D"_blank">[email protected]</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Hi,<br>
<br>
That&#39;s because the nunit2 is running on the framework that NAnt is<br>
currently running on. =A0Which is the highest version of the .NET<br>
framework found on your machine. =A0I see that you have two options.<br>
<br>
1) Compile your project on 4.0<br>
or<br>
2) If you must compile your project on 3.5, then you could edit the<br>
NAnt.exe.config to not run on 4.0 by removing/commenting out the<br>
element listed below at the bottom of the file. =A0Please be advised<br>
that this may also have unforeseen side-effects when running NAnt.<br>
Thus, I do not recommend this course of action.<br>
<br>
Xml Element to delete/comment in NAnt.exe.config:<br>
&lt;supportedRuntime version=3D&quot;v4.0.30319&quot; /&gt;<br>
<br>
Hope this info is helpful.<br>
<br>
Thanks,<br>
Ryan<br>
<div><div class=3D"h5"><br>
On Fri, Jun 1, 2012 at 3:16 AM, Richard Birkby &lt;<a href=3D"mailto:rbirkb=
[email protected]">[email protected]</a>&gt; wrote:<br>
&gt; Hi<br>
&gt;<br>
&gt; I didn&#39;t get a reply to this question on nant-users.<br>
&gt; I want my nant script to run NUnit (&lt;nunit2&gt;) under .Net 3.5 - i=
t runs<br>
&gt; everything else (eg &lt;msbuild&gt;) correctly when I specify a target=
 framework<br>
&gt; of net-3.5.<br>
&gt; But NUnit seems to be run as .Net 4 and consequently I get the followi=
ng<br>
&gt; errors:<br>
&gt;<br>
&gt; =A0 =A0[nunit2] Test Fixture SetUp Failures:<br>
&gt; =A0 =A0[nunit2] 1) AlerterTests : SetUp : System.IO.FileLoadException =
: Mixed<br>
&gt; mode assembly is built against version &#39;v2.0.50727&#39; of the run=
time and<br>
&gt; cannot be loaded in the 4.0 run...<br>
&gt; =A0 =A0[nunit2] at System.Reflection.RuntimeAssembly.GetType(RuntimeAs=
sembly<br>
&gt; assembly, String name, Boolean throwOnError, Boolean ignoreCase,<br>
&gt; ObjectHandleOnStack type)<br>
&gt; =A0 =A0[nunit2] at System.Reflection.RuntimeAssembly.GetType(String na=
me,<br>
&gt; Boolean throwOnError, Boolean ignoreCase)<br>
&gt; =A0 =A0[nunit2] at System.Reflection.Assembly.GetType(String name, Boo=
lean<br>
&gt; throwOnError)<br>
&gt; =A0 =A0[nunit2] at<br>
&gt; Microsoft.SqlServer.Management.Common.ServerConnection.GetStatements(S=
tring<br>
&gt; query, ExecutionTypes executionType, Int32&amp; statementsToReverse)<b=
r>
&gt; =A0 =A0[nunit2] at<br>
&gt; Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery=
(String<br>
&gt; sqlCommand, ExecutionTypes executionType)<br>
&gt;<br>
&gt;<br>
&gt; I still get this problem with 0.92rc1. What can I do about it?<br>
&gt; Is this because &lt;msbuild&gt; is run as a different process, whereas=
 &lt;nunit2&gt; is<br>
&gt; run in the same process as Nant?<br>
&gt;<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Richard<br>
&gt;<br>
&gt;<br>
&gt; ---------- Forwarded message ----------<br>
&gt; From: Richard Birkby &lt;<a href=3D"mailto:[email protected]">rbirkby@=
gmail.com</a>&gt;<br>
&gt; Date: Mon, Oct 24, 2011 at 9:51 AM<br>
&gt; Subject: CLR4/CLR2 NUnit binding<br>
&gt; To: <a href=3D"mailto:[email protected]">nant-users@lis=
ts.sourceforge.net</a><br>
&gt;<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;ve tried to upgrade our Nant 0.90 to Nant 0.91 this morning. Eve=
rything<br>
&gt; went well apart from the test phase where NUnit failed with errors suc=
h as:<br>
&gt;<br>
&gt; =A0: System.IO.FileLoadException : Mixed mode assembly=A0is built agai=
nst<br>
&gt; version &#39;v2.0.50727&#39; of the runtime and cannot be loaded in th=
e=A04.0 runtime<br>
&gt; without additional configuration information.<br>
&gt;<br>
&gt; It appears from ildasm that Nant correctly built my assemblies against=
 .Net<br>
&gt; 3.5, however when it starts running the nunit2 task, it thinks it shou=
ld run<br>
&gt; it as .Net 4.<br>
&gt;<br>
&gt; What should I do to tell it to run it as .Net 3.5?<br>
&gt;<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Richard<br>
&gt; ps There is a small possibility I corrupted the merge of Nant 0.91 int=
o the<br>
&gt; existing structure. Could this be the reason?<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; ----------------------------------------------------------=
--------------------<br>
&gt; Live Security Virtual Conference<br>
&gt; Exclusive live event will cover all the ways today&#39;s security and<=
br>
&gt; threat landscape has changed and how IT managers can respond. Discussi=
ons<br>
&gt; will include endpoint security, mobile security and the latest in malw=
are<br>
&gt; threats. <a href=3D"http://www.accelacomm.com/jaw/sfrnl04242012/114/50=
122263/" target=3D"_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/=
50122263/</a><br>
&gt; _______________________________________________<br>
&gt; nant-developers mailing list<br>
&gt; <a href=3D"mailto:[email protected]">nant-develope=
[email protected]</a><br>
&gt; <a href=3D"https://lists.sourceforge.net/lists/listinfo/nant-developer=
s" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/nant-deve=
lopers</a><br>
&gt;<br>
</blockquote></div><br></div>

--bcaec5431464dc636704c16aebb5--


--===============1022635103975215570==
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/
--===============1022635103975215570==
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

--===============1022635103975215570==--