[IronPython] Specified language provider type is not registered.

Tomas Matousek Tomas.Matousek at microsoft.com
Tue Sep 2 18:25:05 CEST 2008


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: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher
Sent: Monday, September 01, 2008 10:26 PM
To: hellosticky at gmail.com; 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 <hellosticky at gmail.com<mailto:hellosticky at gmail.com>> 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 at lists.ironpython.com<mailto: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/20080902/747af75b/attachment.html>


More information about the Ironpython-users mailing list