<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:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40"
xmlns:ns0="http://schemas.microsoft.com/office/2004/12/omml">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--a:link
        {mso-style-priority:99;}
span.MSOHYPERLINK
        {mso-style-priority:99;}
a:visited
        {mso-style-priority:99;}
span.MSOHYPERLINKFOLLOWED
        {mso-style-priority:99;}

 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Calibri;
        color:#1F497D;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</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=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Oh D&#8217;uh, Thanks!<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>It got further now, but I had built the
binaries in Debug mode and there was an Environment permission exception in:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>internal</span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>static</span></font> <font
color=blue><span style='color:blue'>class</span></font> <font color="#2b91af"><span
style='color:#2B91AF'>DebugOptions</span></font> {</span></font><font size=2
color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>private</span></font> <font
color=blue><span style='color:blue'>static</span></font> <font color=blue><span
style='color:blue'>string</span></font> ReadDebugString(<font color=blue><span
style='color:blue'>string</span></font> name) {<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>#if</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> DEBUG &amp;&amp;
!SILVERLIGHT<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=gray
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:gray'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
try {<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=gray face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:gray'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return Environment.GetEnvironmentVariable(&quot;DLR_&quot; + name);<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=gray face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:gray'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Of course, I will go back and build in Release mode, but I
thought it&#8217;s something you should know &#8211; the assembly acts
differently in partial trust based on the type of release mode.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Tomas Matousek
[mailto:Tomas.Matousek@microsoft.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, September 02, 2008
12:25 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Discussion of <st1:PersonName
w:st="on">IronPython</st1:PersonName>; hellosticky@gmail.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [<st1:PersonName
w:st="on">IronPython</st1:PersonName>] Specified language provider type is not
registered.</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>The problem in your
code is that you update &#8220;setup&#8221; variable after it is passed to
ScriptRuntime. You need to first initialize the setup and then pass it to
runtime ctor (the ctor uses the setup object to create and configure DLR and
once that done no changes are possible).<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));</span></font><font
size=2 color="#1f497d" face=Calibri><span style='font-size:11.0pt;font-family:
Calibri;color:#1F497D'><o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>ScriptRuntime runtime =
new ScriptRuntime(setup);</span></font><font size=2 color="#1f497d"
face=Calibri><span style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>Does this work?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>Tomas<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p>&nbsp;</o:p></span></font></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
users-bounces@lists.ironpython.com [mailto:users-bounces@lists.ironpython.com] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Curt Hagenlocher<br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, September 01, 2008
10:26 PM<br>
<b><span style='font-weight:bold'>To:</span></b> hellosticky@gmail.com;
Discussion of <st1:PersonName w:st="on">IronPython</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [<st1:PersonName
w:st="on">IronPython</st1:PersonName>] Specified language provider type is not
registered.<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Get the ScriptEngine
directly from <st1:PersonName w:st="on">IronPython</st1:PersonName>.Hosting.Python
instead of going through the runtime.<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Mon, Sep 1, 2008 at 10:19 PM, KE &lt;<a
href="mailto:hellosticky@gmail.com">hellosticky@gmail.com</a>&gt; wrote:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hi, I've compiled <st1:PersonName w:st="on">IronPython</st1:PersonName>
from the latest source code, and added some<br>
strong name keys to run in a partial trust AppDomain, but I can't quite get<br>
the ScriptEngine created:<br>
<br>
System.ArgumentException: Unknown language name: 'py'<br>
&nbsp; at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngine(String<br>
languageName)<br>
&nbsp; at mycode<br>
<br>
The code creating this is:<br>
<br>
ScriptRuntimeSetup setup = new ScriptRuntimeSetup();<br>
ScriptRuntime runtime = new ScriptRuntime(setup);<br>
setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));<br>
runtime.LoadAssembly(assembly);<br>
runtime.IO.SetOutput(ms, writer);<br>
ScriptEngine engine = runtime.GetEngine(&quot;py&quot;);<br>
ScriptScope scope = engine.CreateScope();<br>
<br>
<br>
I would prefer to do this programmatically, without any external .config<br>
files, if possible.<br>
Thanks!<br>
<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></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</div>

</body>

</html>