The latest version of the Hosting API spec is available here. The most recent source code drop to the IronPython codeplex site conforms to this spec (except for some open bugs).

The biggest change this spec introduces to the beta4 binaries is the way the hosting runtime is initialized.

Prior to this update, the hosting runtime is initialized by creating a new ScriptRuntime object. Now, a typical runtime initialization involves 2 things.

A quick 5 min how-to on the new initialization is as follows

1)      Setting up entries in the application’s config file. Here is a sample config file

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

  <configSections>

    <section name="microsoft.scripting" 

             type="Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting, Version=1.0.0.5000, Culture=neutral, publicKeyToken=31bf3856ad364e35"     

             requirePermission="false" />

  </configSections>

 

  <microsoft.scripting>

    <languages>

      <language names="IronPython,Python,py"

                extensions=".py"

                displayName="IronPython 2.0 Beta"

                type="IronPython.Runtime.PythonContext,IronPython, Version=2.0.0.5000, Culture=neutral, publicKeyToken=31bf3856ad364e35" />

      <language names="IronRuby;Ruby,rb"

                extensions=".rb"

                displayName="IronRuby 1.0 Alpha"

                type="IronRuby.Runtime.RubyContext, IronRuby, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    </languages>

  </microsoft.scripting>

</configuration>

 

2)      Calling the following methods

ScriptRuntimeSetup srs = ScriptRuntimeSetup.ReadConfiguration();

ScriptRuntime runtime = new ScriptRuntime(srs);