[IronPython] Adding methods in hosting application during runtime

Dino Viehland dinov at exchange.microsoft.com
Fri Sep 15 16:49:27 CEST 2006

The short answer is no, you can't create assemblies that are visible by reflection.

We do have a highly-experimental static type compiler that's included w/ IronPython 1.0 but it won't pass the same set of tests that the normal version passes (in other words, it's not nearly complete).  That currently only gets enabled when compiling via the CodeDom APIs - if you were to call those APIs to compile your code you'd end up with an assembly that would work.  The only question is how well it would work :).

Another option would be if AjaxPro used ICustomTypeDescriptor in addition to reflection it could see the attributes on a Python object.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Bernd Rössl
Sent: Friday, September 15, 2006 7:40 AM
To: users at lists.ironpython.com
Subject: [IronPython] Adding methods in hosting application during runtime

Still working on integrating ironPython in a web application and just tryed to do some ajax stuff with AjaxPro. Duriing implementation i realized that i can't use AjaxPro like the way i do it in c# or vb. not at least of the problem with the method attributes but the real problem is the matter of fact that objects i created in the python enviroment aren't available by ajaxpro because the generated html script looks like this

<script type="text/javascript"
...and this thing does not exist :(

I think a nice way would be to extend the hosting application with some objects they life next to all classic .NET objects so that a external caller could not see a difference. But this wouldn't work because the hosting app isn't dynamic, or does it?
One thought was to use IronPython.Compiler to create a 'real' assembly and then load it into the hosting application but that sounds a little bit strange.

So my question is :

Is it possible to create objects in the hosting application from a python script that are callable from extern by reflection (i think ajaxpro does it by reflection) ?

If i'm absolutly on the wrong way to relize this let me know.

thanks, bernd

View this message in context: http://www.nabble.com/Adding-methods-in-hosting-application-during-runtime-tf2277947.html#a6326609
Sent from the IronPython forum at Nabble.com.

users mailing list
users at lists.ironpython.com

More information about the Ironpython-users mailing list