The NGWS runtime is typically started and managed by environments like ASP+, IE or the Windows Shell. These hosting environments need to run managed code on behalf of the user and take advantage of the application isolation features provided by Application Domains. In fact it is the host that determines where the Application Domain boundaries lie and in what domain user code gets run in.
The NGWS runtime provides a set of classes and interfaces used by hosts to create and manage Application Domains. See the specification entitled Hosting Interfaces for a description of how to use these classes and interfaces.
Examples of current NGWS runtime hosts include:
ASP+
ASP+ creates Application Domains to run user code. Domains are created per application as defined by the web server.
IE
By default, IE creates an application domain per site. However, this behavior can be customized by the developer.
Shell EXE
Each application that is launched from the command line runs in a separate app domain.
VBA
VBA runs the script code contained in an Office document in an AppDomain
WFC Forms Designer
The WFC Forms Designer places each form the user is building in a separate AppDomain. When the user edits the form and rebuilds, WFC shuts down the old domain, recompiles the code and runs it in a new domain.
SQL Server
SQL Server allows user-provided functions to be written in any NGWS runtime language. These functions can then be called from SQL statements. In addition, SQL generates and runs IL to evaluate expressions in SQL statements.