Re: 0.92 Beta 1 release not compiled with NET_4_0 define

Ryan Boggs <[email protected]> Mon, 14 May 2012 10:07:20 -0700
Newsgroups gmane.comp.windows.dotnet.nant.user
Message-ID <CAJg1EnDymPLvteVmY5=3v+V6W3+C03dc2h6OeW=aQgVfR__C7Q@mail.gmail.com>
--===============3685396854689403818==
Content-Type: multipart/alternative; boundary=0016e6d45fbe7ee23a04c0021e68

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

Hi Peter,
That preprocessing statement was added during the 0.91 release phase, when
NAnt was still using the .NET 1.0 runtime by default.  We were having
issues between .NET 1.0 and 4.0, which is why that statement is there.  I
just took a look at the .NET docs and the AppDomain.CreateDomain method you
mentioned was actually created in .NET 2.0 (my fault for thinking it was
added in .NET 4.0).  Based on my findings and the fact that we are now
building NAnt/NAntContrib on .NET 2.0 runtime (as of 0.92 Alpha1), we can
just eliminate that preprocessing statement altogether and just use the
AppDomain.CreateDomain method with the PermissionSet as standard without
issues.  It'll need testing, of course.

Would you mind adding this to our issues list for tracking purposes?  I'll
see if I can get to this within the next couple of days.
https://github.com/nant/nant/issues

Thanks,
Ryan

On Mon, May 14, 2012 at 9:34 AM, Peter McEvoy <[email protected]>wrote:

> Hi there,
> I've been trying to use the nunit2 task to unit test some MVC controllers
> and have been seeing the following exception:
>
>   [nunit2] 21)
> Otu.Web.UnitTests.Controllers.RegistrationControllerUnitTests.Execute_should_return_registration_complete_view_when_registration_is_in_session
> : SetUp : System.InvalidOperationException : Dynamic operations can only be
> performed in homogenous AppDomain.
>
> Investigating a little further, it seems that the task should be creating
> Homogenous AppDomains when running test assemblies that may be using DLR
> features.
>
> Looking at the source, it seems  that someone did think of this, but the
> code is #if'd out, and that code does not appear in the download binaries :
>
> #if NET_4_0
>             PermissionSet myDomainPermSet = new
> PermissionSet(PermissionState.Unrestricted);
>             return AppDomain.CreateDomain(domSetup.ApplicationName,
> AppDomain.CurrentDomain.Evidence, domSetup, myDomainPermSet);
> #else
>
>
> I realize that 4.0 specific code may not be to everyone's taste, but
> perhaps there could be a side-by-side release of a .Net 4.0 binary build?
>  (I'd really prefer to be using "blessed" releases rather than baking my
> own)
>
>
> Pete
>
> --
> <http://www.fsf.org/fb>
> http://www.fsf.org/facebook
> http://bit.ly/hzA1MS
> http://bit.ly/fztcGn
> http://cli.gs/V1UtWw
> http://cli.gs/S3zVIt
> http://goo.gl/ZBptR
> http://goo.gl/tXFO7 <http://goo.gl/ZBptR>
>
>
>
>
> ------------------------------------------------------------------------------
> 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-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nant-users
>
>

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

Hi Peter,<br>That preprocessing statement was added during the 0.91 release=
 phase, when NAnt was still using the .NET 1.0 runtime by default.=A0 We we=
re having issues between .NET 1.0 and 4.0, which is why that statement is t=
here.=A0 I just took a look at the .NET docs and the AppDomain.CreateDomain=
 method you mentioned was actually created in .NET 2.0 (my fault for thinki=
ng it was added in .NET 4.0).=A0 Based on my findings and the fact that we =
are now building NAnt/NAntContrib on .NET 2.0 runtime (as of 0.92 Alpha1), =
we can just eliminate that preprocessing statement altogether and just use =
the AppDomain.CreateDomain method with the PermissionSet as standard withou=
t issues.=A0 It&#39;ll need testing, of course.<br>
<br>Would you mind adding this to our issues list for tracking purposes?=A0=
 I&#39;ll see if I can get to this within the next couple of days.<br><a hr=
ef=3D"https://github.com/nant/nant/issues">https://github.com/nant/nant/iss=
ues</a><br>
<br>Thanks,<br>Ryan<br><br><div class=3D"gmail_quote">On Mon, May 14, 2012 =
at 9:34 AM, Peter McEvoy <span dir=3D"ltr">&lt;<a href=3D"mailto:peter.m.mc=
[email protected]" target=3D"_blank">[email protected]</a>&gt;</span> w=
rote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Hi there,<div>I&#39;ve been trying to use th=
e nunit2 task to unit test some MVC controllers and have been seeing the fo=
llowing exception:</div>
<div><br></div><div><div>=A0 [nunit2] 21) Otu.Web.UnitTests.Controllers.Reg=
istrationControllerUnitTests.Execute_should_return_registration_complete_vi=
ew_when_registration_is_in_session : SetUp : System.InvalidOperationExcepti=
on=A0: Dynamic operations can only be performed in homogenous AppDomain.</d=
iv>

</div><div><br></div><div>Investigating a little further, it seems that the=
 task should be creating Homogenous AppDomains when running test assemblies=
 that may be using DLR features.</div><div><br></div><div>Looking at the so=
urce, it seems =A0that someone did think of this, but the code is #if&#39;d=
 out, and that code does not appear in the download binaries :</div>

<div><br></div><div><div>#if NET_4_0</div><div>=A0 =A0 =A0 =A0 =A0 =A0 Perm=
issionSet myDomainPermSet =3D new PermissionSet(PermissionState.Unrestricte=
d);</div><div>=A0 =A0 =A0 =A0 =A0 =A0 return AppDomain.CreateDomain(domSetu=
p.ApplicationName, AppDomain.CurrentDomain.Evidence, domSetup, myDomainPerm=
Set);</div>

<div>#else</div></div><div><br></div><div><br></div><div>I=A0realize=A0that=
 4.0 specific code may not be to everyone&#39;s taste, but perhaps there co=
uld be a side-by-side release of a .Net 4.0 binary build? =A0(I&#39;d reall=
y prefer to be using &quot;blessed&quot; releases rather than baking my own=
)</div>

<div><br></div><div><br></div><div>Pete<span class=3D"HOEnZb"><font color=
=3D"#888888"><br clear=3D"all"><div><br></div>-- <br><a href=3D"http://www.=
fsf.org/fb" target=3D"_blank"><img src=3D"" height=3D"66" width=3D"200"></a=
><br><div><a href=3D"http://www.fsf.org/facebook" target=3D"_blank"><font s=
ize=3D"1">http://www.fsf.org/facebook</font></a></div>

<div><font size=3D"1"><a href=3D"http://bit.ly/hzA1MS" target=3D"_blank">ht=
tp://bit.ly/hzA1MS</a><br></font></div><div><font size=3D"1"><a href=3D"htt=
p://bit.ly/fztcGn" target=3D"_blank">http://bit.ly/fztcGn</a><br></font></d=
iv><div>

<font size=3D"1"><a href=3D"http://cli.gs/V1UtWw" target=3D"_blank">http://=
cli.gs/V1UtWw</a></font></div><div><font size=3D"1"><a href=3D"http://cli.g=
s/S3zVIt" target=3D"_blank">http://cli.gs/S3zVIt</a></font></div><div><a hr=
ef=3D"http://goo.gl/ZBptR" style=3D"font-size:x-small" target=3D"_blank">ht=
tp://goo.gl/ZBptR<br>

</a></div><div><a href=3D"http://goo.gl/ZBptR" target=3D"_blank"><font size=
=3D"1">http://goo.gl/tXFO7</font></a></div><div><br></div><br>
</font></span></div>
<br>-----------------------------------------------------------------------=
-------<br>
Live Security Virtual Conference<br>
Exclusive live event will cover all the ways today&#39;s security and<br>
threat landscape has changed and how IT managers can respond. Discussions<b=
r>
will include endpoint security, mobile security and the latest in malware<b=
r>
threats. <a href=3D"http://www.accelacomm.com/jaw/sfrnl04242012/114/5012226=
3/" target=3D"_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122=
263/</a><br>_______________________________________________<br>
NAnt-users mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]=
forge.net</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/nant-users" target=
=3D"_blank">https://lists.sourceforge.net/lists/listinfo/nant-users</a><br>
<br></blockquote></div><br>

--0016e6d45fbe7ee23a04c0021e68--


--===============3685396854689403818==
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/
--===============3685396854689403818==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
NAnt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users

--===============3685396854689403818==--