I ran into the same problem using our product (LabVIEW) but the fix is
fairly simple - go into AssemblyGen.cs of the IronPython assembly and
delete the last parameter (domain.Evidence) of the two
DefineDynamicAssembly() methods.<br>
<br>
The problem comes up when you try to host the IronPython engine inside
any AppDomain other than the DefaultDomain (as I assume you are doing
in AutoCAD, we are doing in LabVIEW and as you would find if you tried
<a href="http://ASP.NET">ASP.NET</a>). The most common way to create a new AppDomain is with null
evidence, because you typically rely on the assembly evidence to handle
CAS (as you were trying to do with caspol). Even if you do
domain.Evidence when creating your own AppDomain, you still get null -
there is something about the DefaultDomain that we are not inheriting.<br>
<br>
If you read the docs on DefineDynamicAssembly(), you'll see that only
fully trusted callers can supply evidence - and somehow we are
not...I'm still trying to figure out what's the special invocation to
make it work with the evidence, but so far I've only found one way -
create your own evidence when creating your AppDomain and add
MyComputer as the Zone. I'm not about to ship that code as it seems to
break just about every part of CAS, but it is a clue...<br>
<br>
Brian<br>
<br>