<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
-->
</style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D">I think this issue is an old version of IronPython.&nbsp; Silverlight 4 included a breaking change which broke IronPython 2.0.2 and maybe 2.6.0.&nbsp; I think we fixed
 the issues for 2.0.3 and 2.6.1.&nbsp; So the solution should be to use a newer version of IronPython.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> users-bounces@lists.ironpython.com [mailto:users-bounces@lists.ironpython.com]
<b>On Behalf Of </b>Jimmy Schementi<br>
<b>Sent:</b> Tuesday, August 24, 2010 10:44 AM<br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] embedded ironpython in silverlight - class definitions<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">When I run that code (with Visual Studio 2010, Silverlight 4, and IronPython 2.7) I get a Python syntax error &quot;unexpected token &lt;newline&gt;&quot;, because you don't have a &quot;:&quot; after the __init__ function. When that is corrected, your example works
 properly.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Here's the working example: <a href="http://jimmy.schementi.com/silverlight/ipysl-repro20100824.zip">
http://jimmy.schementi.com/silverlight/ipysl-repro20100824.zip</a>. See the Bin\Debug directory ... the HTML file and XAP for the app are in there, which contains the IronPython assemblies.<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">~Jimmy<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">On Tue, Aug 24, 2010 at 9:54 AM, Fortelny, Stephan &lt;<a href="mailto:stephan.fortelny@rubicon.eu">stephan.fortelny@rubicon.eu</a>&gt; wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.9pt;mso-margin-bottom-alt:
auto;text-autospace:none">
<span style="font-size:10.0pt;color:black">hi there,</span><span lang="DE-AT"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.9pt;mso-margin-bottom-alt:
auto;text-autospace:none">
<span style="font-size:10.0pt;color:black">i'm trying to use ironpython embedded in silverlight
</span><span lang="DE-AT"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.9pt;mso-margin-bottom-alt:
auto;text-autospace:none">
<span style="font-size:10.0pt;color:black">there is a tutorial here </span><u><span style="font-size:10.0pt;color:#0066CC"><a href="http://www.voidspace.org.uk/ironpython/silverlight/embedding_ironpython.shtml" target="_blank">http://www.voidspace.org.uk/ironpython/silverlight/embedding_ironpython.shtml</a></span></u><span style="font-size:10.0pt;color:black">
 but it seems that you can not define your own classes. </span><span lang="DE-AT"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.9pt;mso-margin-bottom-alt:
auto;text-autospace:none">
<span style="font-size:10.0pt;color:black">When doing this in a script i get an &quot;MethodAccessException&quot; when accessing &quot;System.RuntimeMethodHandle.get_Value()&quot;&nbsp; somewhere in the ctor of the defined class.</span><span lang="DE-AT"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;color:black">This due to Silverlight having no security privileges so does anybody know how to solve this?</span><span lang="DE-AT"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;color:black">&nbsp;</span><span lang="DE-AT"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;color:black">My code sample
</span><a href="http://pastebin.com/7j8iXEAE" target="_blank">http://pastebin.com/7j8iXEAE</a> 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<span lang="DE-AT"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>