It's actually a CLR bug - we can't call this method from a dynamic method.  We 
could probably add a workaround and force it to always be called via reflection.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Curt Hagenlocher
Sent: Friday, March 20, 2009 5:29 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Creating Dynamic Assemblies from IronPython 2.6

I think this is something that broke well before the 2.0 release.  To work 
around it in pyc.py, we added DefineDynamicAssembly to the PythonOps class in 
IronPython:

import clr
clr.AddReference('IronPython')
from IronPython.Runtime.Operations import PythonOps
assemblyBuilder = PythonOps.DefineDynamicAssembly(...)
2009/3/20 Jeff Hardy <[email protected]<mailto:[email protected]>>
Hi all,
I'm unable to create a Dynamic assembly from IronPython using
AppDomain.DefineDynamicAssembly. The Python file attached results in
the following error:

Traceback (most recent call last):
 File "pinvoke.py", line 5, in pinvoke.py
 File "mscorlib", line unknown, in DefineDynamicAssembly
 File "mscorlib", line unknown, in InternalDefineDynamicAssembly
 File "mscorlib", line unknown, in nCreateDynamicAssembly
 File "mscorlib", line unknown, in CheckGrantSetHelper
SystemError: Object reference not set to an instance of an object.

The equivalent C# program (also attached) works fine. I'm guessing
there's something special about IronPython's AppDomain, but I'm not
sure what it is. This is using revision 48140. Any ideas?

- Jeff

_______________________________________________
Users mailing list
[email protected]<mailto:[email protected]>
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to