[IronPython] embedded ironpython in silverlight - class definitions

Jimmy Schementi jimmy at schementi.com
Tue Aug 24 19:44:05 CEST 2010


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.

~Jimmy


On Tue, Aug 24, 2010 at 9:54 AM, Fortelny, Stephan <
stephan.fortelny at rubicon.eu> wrote:

> hi there,
>
> 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
> 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/20100824/85a7bc63/attachment.html>


More information about the Ironpython-users mailing list