Re: [IronPython] Specified language provider type is not registered.

2008-09-02 Thread Tomas Matousek
The problem in your code is that you update setup 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).

setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));
ScriptRuntime runtime = new ScriptRuntime(setup);

Does this work?

Tomas

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Curt Hagenlocher
Sent: Monday, September 01, 2008 10:26 PM
To: [EMAIL PROTECTED]; Discussion of IronPython
Subject: Re: [IronPython] Specified language provider type is not registered.

Get the ScriptEngine directly from IronPython.Hosting.Python instead of going 
through the runtime.
On Mon, Sep 1, 2008 at 10:19 PM, KE [EMAIL PROTECTED]mailto:[EMAIL 
PROTECTED] wrote:
Hi, I've compiled IronPython from the latest source code, and added some
strong name keys to run in a partial trust AppDomain, but I can't quite get
the ScriptEngine created:

System.ArgumentException: Unknown language name: 'py'
  at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngine(String
languageName)
  at mycode

The code creating this is:

ScriptRuntimeSetup setup = new ScriptRuntimeSetup();
ScriptRuntime runtime = new ScriptRuntime(setup);
setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));
runtime.LoadAssembly(assembly);
runtime.IO.SetOutput(ms, writer);
ScriptEngine engine = runtime.GetEngine(py);
ScriptScope scope = engine.CreateScope();


I would prefer to do this programmatically, without any external .config
files, if possible.
Thanks!

___
Users mailing list
Users@lists.ironpython.commailto:Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Specified language provider type is not registered.

2008-09-02 Thread Tomas Matousek
Right. That's expected behavior. The exception is caught there, isn't it?
DLR can be tweaked so that it dumps debugging information about generated IL, 
trees, etc. Compiler developers building their own language on top of DLR might 
want to use DLR_* options while debugging their compilers to get useful 
information out of DLR.

Tomas

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of KE
Sent: Tuesday, September 02, 2008 3:34 PM
To: Tomas Matousek; 'Discussion of IronPython'
Subject: Re: [IronPython] Specified language provider type is not registered.

Oh D'uh, Thanks!

It got further now, but I had built the binaries in Debug mode and there was an 
Environment permission exception in:

internal static class DebugOptions {
private static string ReadDebugString(string name) {
#if DEBUG  !SILVERLIGHT
try {
return Environment.GetEnvironmentVariable(DLR_ + name);

Of course, I will go back and build in Release mode, but I thought it's 
something you should know - the assembly acts differently in partial trust 
based on the type of release mode.
Thanks,


From: Tomas Matousek [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 02, 2008 12:25 PM
To: Discussion of IronPython; [EMAIL PROTECTED]
Subject: RE: [IronPython] Specified language provider type is not registered.

The problem in your code is that you update setup 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).

setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));
ScriptRuntime runtime = new ScriptRuntime(setup);
Does this work?

Tomas

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Curt Hagenlocher
Sent: Monday, September 01, 2008 10:26 PM
To: [EMAIL PROTECTED]; Discussion of IronPython
Subject: Re: [IronPython] Specified language provider type is not registered.

Get the ScriptEngine directly from IronPython.Hosting.Python instead of going 
through the runtime.
On Mon, Sep 1, 2008 at 10:19 PM, KE [EMAIL PROTECTED]mailto:[EMAIL 
PROTECTED] wrote:
Hi, I've compiled IronPython from the latest source code, and added some
strong name keys to run in a partial trust AppDomain, but I can't quite get
the ScriptEngine created:

System.ArgumentException: Unknown language name: 'py'
  at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngine(String
languageName)
  at mycode

The code creating this is:

ScriptRuntimeSetup setup = new ScriptRuntimeSetup();
ScriptRuntime runtime = new ScriptRuntime(setup);
setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));
runtime.LoadAssembly(assembly);
runtime.IO.SetOutput(ms, writer);
ScriptEngine engine = runtime.GetEngine(py);
ScriptScope scope = engine.CreateScope();


I would prefer to do this programmatically, without any external .config
files, if possible.
Thanks!

___
Users mailing list
Users@lists.ironpython.commailto:Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Specified language provider type is not registered.

2008-09-02 Thread KE
That makes sense. Unfortunately, it did not catch the exception. It threw a
SecurityException into my application which caused it to crash. I have
switched to Release mode so it is no longer an issue for me.

Thanks,

 

  _  

From: Tomas Matousek [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 02, 2008 7:46 PM
To: [EMAIL PROTECTED]; Discussion of IronPython
Subject: RE: [IronPython] Specified language provider type is not
registered.

 

Right. That's expected behavior. The exception is caught there, isn't it?

DLR can be tweaked so that it dumps debugging information about generated
IL, trees, etc. Compiler developers building their own language on top of
DLR might want to use DLR_* options while debugging their compilers to get
useful information out of DLR.

 

Tomas

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of KE
Sent: Tuesday, September 02, 2008 3:34 PM
To: Tomas Matousek; 'Discussion of IronPython'
Subject: Re: [IronPython] Specified language provider type is not
registered.

 

Oh D'uh, Thanks!

 

It got further now, but I had built the binaries in Debug mode and there was
an Environment permission exception in:

 

internal static class DebugOptions {

private static string ReadDebugString(string name) {

#if DEBUG  !SILVERLIGHT

try {

return Environment.GetEnvironmentVariable(DLR_ + name);

 

Of course, I will go back and build in Release mode, but I thought it's
something you should know - the assembly acts differently in partial trust
based on the type of release mode.

Thanks,

 

  _  

From: Tomas Matousek [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 02, 2008 12:25 PM
To: Discussion of IronPython; [EMAIL PROTECTED]
Subject: RE: [IronPython] Specified language provider type is not
registered.

 

The problem in your code is that you update setup 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).

 

setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));

ScriptRuntime runtime = new ScriptRuntime(setup);

Does this work?

 

Tomas

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Curt Hagenlocher
Sent: Monday, September 01, 2008 10:26 PM
To: [EMAIL PROTECTED]; Discussion of IronPython
Subject: Re: [IronPython] Specified language provider type is not
registered.

 

Get the ScriptEngine directly from IronPython.Hosting.Python instead of
going through the runtime.

On Mon, Sep 1, 2008 at 10:19 PM, KE [EMAIL PROTECTED] wrote:

Hi, I've compiled IronPython from the latest source code, and added some
strong name keys to run in a partial trust AppDomain, but I can't quite get
the ScriptEngine created:

System.ArgumentException: Unknown language name: 'py'
  at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngine(String
languageName)
  at mycode

The code creating this is:

ScriptRuntimeSetup setup = new ScriptRuntimeSetup();
ScriptRuntime runtime = new ScriptRuntime(setup);
setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));
runtime.LoadAssembly(assembly);
runtime.IO.SetOutput(ms, writer);
ScriptEngine engine = runtime.GetEngine(py);
ScriptScope scope = engine.CreateScope();


I would prefer to do this programmatically, without any external .config
files, if possible.
Thanks!

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

 

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Specified language provider type is not registered.

2008-09-01 Thread KE
Hi, I've compiled IronPython from the latest source code, and added some
strong name keys to run in a partial trust AppDomain, but I can't quite get
the ScriptEngine created:

System.ArgumentException: Unknown language name: 'py'
   at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngine(String
languageName)
   at mycode

The code creating this is:

ScriptRuntimeSetup setup = new ScriptRuntimeSetup();
ScriptRuntime runtime = new ScriptRuntime(setup);
setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));
runtime.LoadAssembly(assembly);
runtime.IO.SetOutput(ms, writer);
ScriptEngine engine = runtime.GetEngine(py);
ScriptScope scope = engine.CreateScope();


I would prefer to do this programmatically, without any external .config
files, if possible.
Thanks!

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Specified language provider type is not registered.

2008-09-01 Thread Curt Hagenlocher
Get the ScriptEngine directly from IronPython.Hosting.Python instead of
going through the runtime.

On Mon, Sep 1, 2008 at 10:19 PM, KE [EMAIL PROTECTED] wrote:

 Hi, I've compiled IronPython from the latest source code, and added some
 strong name keys to run in a partial trust AppDomain, but I can't quite get
 the ScriptEngine created:

 System.ArgumentException: Unknown language name: 'py'
   at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngine(String
 languageName)
   at mycode

 The code creating this is:

 ScriptRuntimeSetup setup = new ScriptRuntimeSetup();
 ScriptRuntime runtime = new ScriptRuntime(setup);
 setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));
 runtime.LoadAssembly(assembly);
 runtime.IO.SetOutput(ms, writer);
 ScriptEngine engine = runtime.GetEngine(py);
 ScriptScope scope = engine.CreateScope();


 I would prefer to do this programmatically, without any external .config
 files, if possible.
 Thanks!

 ___
 Users mailing list
 Users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com