The Dynamic Language Runtime shell allows for interactively executing dynamic language code in the Silverlight application domain. Use the DLR shell to perform operations on a Silverlight application that are not available in any of the other parts of Silverlight Spy. The DLR shell allows for advanced querying and automation of any Silverlight application. The shell provides full access to any runtime object in the Silverlight AppDomain.

To display the DLR Shell, select DLR Shell from the View menu.

Figure 1:DLR Shell

Executing DLR code

The DLR Shell presents a user interface that is similar to SQL Server Query Analyzer. Type your DLR code in the DLR shell and hit Execute to execute the code and view the results in the output pane.

Tip

Use CTRL-E to execute code.

The DLR Shell supports both Python and Ruby DLR languages. Select the appropiate language in the toolbar. Silverlight Spy ensures the required DLR assemblies are loaded into the Silverlight AppDomain. There is no need to reference the DLR assemblies in the Silverlight application.

The DLR Shell provides a full syntax colored editor.

Note

Every DLR code execution is performed in its own script scope. DLR execution is isolated where variables and functions of a previous execution are not available.