DLR Hosting Sample : Simple dlr host using the new App.Config based ScriptRuntime creation

Due to the recent changes to the DLR Hosting API, dlr hosts now have to use the App.Config file to configure the languages they intend to use in the application. It’s probably a little bit more complex than before to get started on Hosting the DLR after this change.

The attached self contained sample(for VS 2008) addresses this and tries to make it easier to ‘get started’. The sample is a very simple console application that -

1) Hosts the dlr

2) Uses the ScriptRuntimeSetup.ReadConfiguration() and the ScriptRuntime constructor to create the runtime based on the entries in the App.Config file

3) Creates 2 language engines – one for IronPython and 1 for IronRuby

4) Creates a variable in IronPython and prints the value in C#.

The sample contains a pre configured App.Config file. You should be able to just extract the files locally and build the sample and execute it. The dlr and language binaries are also included (in the ‘lib’ folder). Note that these post IronPython V2 beta4 binaries are for demo purposes only and come with no warranty or support.