Demos for Mix 09
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
spreadsheet @ 645fce8


Silverlight Dynamic Lanugage Demos for MIX 09


Testing C# Silverlight application with IronRuby

To run, open TicTacToe\TicTacToe.sln in Visual Studio. TicTacToe.Web is a ASP.NET MVC project, so install ASP.NET MVC here:

Make sure TicTacToe.Web is the start project, and TicTacToeTestPage.aspx is the start page.

To run tests, add "?test" to the end of the URL.


A calculator with IronPython functions

To run, open Calculator\Calculator.sln in Visual Studio. TicTacToe.Web is a ASP.NET MVC project, so install ASP.NET MVC here:

Make sure Calculator.Web is the start project, and CalculatorTestAppTestPage.aspx is the start page.

When you add a valid python function in the right textbox, buttons will be created above to run the functions, with the first argument being the current calculator value.

To run tests, add "?test" to the end of the URL.


Making Silverlight applications in DLR languages

See for more information


Testing Silverlight applications with IronRuby

TicTacToe and Calculator use Eggs to run tests. See for more information.

Silverlight Extensions

Silverlight 3 supports extension for platform components, such as controls the DLR, etc. Run extension-example\server.bat to see how extensions work.

To use the DLR extensions in your application, add a Deployment.ExternalParts section to your AppManifest.xaml file (or Properties\AppManifest.xml) if it's a C#/VB Silverlight project).

    <!-- Required: Microsoft.Scripting(Core, Silverlight, ExtensionAttribute) -->
    <ExtensionPart Source="" />

    <!-- IronRuby and IronRuby.Libraries -->
    <ExtensionPart Source="" />

    <!-- IronPython and IronPython.Modules -->
    <ExtensionPart Source="" />

If you are not using IronRuby in your application, you can remove its ExtensionPart entry, and the same for IronPython. However, the first one is required, as it points to Microsot.Scripting.* DLLs.

Also, if you are using these in a C#/VB Silverlight application, you need to keep the local references to Microsoft.Scripting*.dll and Iron*.dll so it builds, but you don't want them packaged inside the XAP. To accomplish this, select all those DLLs, right-click and select "Properties", and set "Copy Local" to "False".

Lastly, in a C#/VB application you must tell the DLR to load and register any extension assemblies before using any DLR features. This can simply be accomplished by wrapping the setting of RootVisual with a call to DynamicApplication.LoadAssemblies:

DynamicApplication.LoadAssemblies(delegate() {
    this.RootVisual = new Page();