ECMA-CLI(Mono)/.Net CLR Runtime Hosting tutorial
Integrating Common Language Runtime Objects with Virtuoso Using Restrictions for C# Imported types.

## Overview

This tutorial demonstrates the options PERMISSION_SET = SAFE and PERMISSION_SET = UNRESTRICTED on CREATE LIBRARY / ASSEMBLY.

## Prerequisites

The following prerequisites ensure the usability of these demos on Windows

- Windows
  - .NET Runtime and Frameworks
  - .Net Runtime and Framework SDK (if you seek to write your own Objects for integration with Virtuoso)
  - Virtuoso Universal Server for Windows with .NET CLR Hosting

## Tutorial Example

The tutorial shows how C# classes are used to create User Defined Types (UDTs) in Virtuoso.

Please follow the steps below to maximize the value of this tutorial:

1. Click on the "Set Initial State" link which registers the two C# classes within Virtuoso. It also copies the restricted.dll and unrestricted.dll files to "tmp" directory in the server root. Note that the directory must exists, must be writeable for the user running virtuoso and must be in the DirsAllowed parameter in Virtuoso ini file. Click on the "ho_s_11.sql" link to examine the code behind this step.
2. Click on the "Run" links to execute the demo.

Demo Breakdown

1. "ho_s_11.sql" performs the following steps
   1. Registers the "Rest" and "UnRest" classes with Virtuoso. Click on the "restricted.cs" and "unrestricted.cs" links to see the C# source code of these classes.
2. The "unrestricted.vsp" is shows classes that try to access File system and system variables. The "restricted.vsp", uses the same clases, but cannot complete the execution sucessfully because the assembly is imported with PERMISSION_SET = SAFE. The sample shows the error returned upon executing the classes.