[IronPython] embedded ironpython in silverlight - class definitions
dinov at microsoft.com
Tue Aug 24 10:47:22 PDT 2010
I think this issue is an old version of IronPython. Silverlight 4 included a breaking change which broke IronPython 2.0.2 and maybe 2.6.0. I think we fixed the issues for 2.0.3 and 2.6.1. So the solution should be to use a newer version of IronPython.
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi
Sent: Tuesday, August 24, 2010 10:44 AM
To: Discussion of IronPython
Subject: Re: [IronPython] embedded ironpython in silverlight - class definitions
When I run that code (with Visual Studio 2010, Silverlight 4, and IronPython 2.7) I get a Python syntax error "unexpected token <newline>", because you don't have a ":" after the __init__ function. When that is corrected, your example works properly.
Here's the working example: http://jimmy.schementi.com/silverlight/ipysl-repro20100824.zip. See the Bin\Debug directory ... the HTML file and XAP for the app are in there, which contains the IronPython assemblies.
On Tue, Aug 24, 2010 at 9:54 AM, Fortelny, Stephan <stephan.fortelny at rubicon.eu<mailto:stephan.fortelny at rubicon.eu>> wrote:
i'm trying to use ironpython embedded in silverlight
there is a tutorial here http://www.voidspace.org.uk/ironpython/silverlight/embedding_ironpython.shtml but it seems that you can not define your own classes.
When doing this in a script i get an "MethodAccessException" when accessing "System.RuntimeMethodHandle.get_Value()" somewhere in the ctor of the defined class.
This due to Silverlight having no security privileges so does anybody know how to solve this?
My code sample http://pastebin.com/7j8iXEAE which basically creates a ironpython script extracting it to a delegate. Then it calls the defined function. IronPython stdout is set to a stream which is used later to set the text of a textbox
Users mailing list
Users at lists.ironpython.com<mailto:Users at lists.ironpython.com>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Users