[IronPython] Creating Dynamic Assemblies from IronPython 2.6

Curt Hagenlocher curt at hagenlocher.org
Sat Mar 21 18:51:36 CET 2009


In case it's interesting or useful, I've attached some p/Invoke stuff I was
playing with before I got derailed by the DefineDynamicAssembly problem and
then joined Microsoft :).

On Sat, Mar 21, 2009 at 10:45 AM, Dino Viehland <dinov at microsoft.com> wrote:

> If you only have 1 method and don't need overload resolution I'd suggest
> making a delegate using System.Delegate.CreateDelegate.   Otherwise this
> could be made public.
>
> > -----Original Message-----
> > From: users-bounces at lists.ironpython.com [mailto:users-
> > bounces at lists.ironpython.com] On Behalf Of Jeff Hardy
> > Sent: Saturday, March 21, 2009 9:44 AM
> > To: Discussion of IronPython
> > Subject: Re: [IronPython] Creating Dynamic Assemblies from IronPython
> > 2.6
> >
> > Thanks Curt, that worked. Now I have a new problem - I can get a
> > MethodInfo, but I need to be able to convert it to something I can
> > call. Seo's old code used BuiltinFunction.MakeOrAdd, but that is now
> > internal. Can this be made public, or is there a better way to handle
> > it?
> >
> > - Jeff
> >
> > 2009/3/20 Curt Hagenlocher <curt at hagenlocher.org>:
> > > 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(...)
> > >
> > _______________________________________________
> > Users mailing list
> > Users at lists.ironpython.com
> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090321/5b12f5cc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pinvoke.py
Type: application/octet-stream
Size: 7523 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090321/5b12f5cc/attachment.obj>


More information about the Ironpython-users mailing list