Creating Application Domains and Executing Assemblies

You have two ways for executing assemblies inside application domains: getting the instance of the default application domain for the running assembly (that is, your application) and creating a new application domain. The System.AppDomain class provides a shared property named CurrentDomain, of type System.AppDomain, which represents the instance of the current application domain. You get the instance and then execute the assembly as follows:

Dim currentDomain As AppDomain = AppDomain.CurrentDomaincurrentDomain.ExecuteAssembly("AnotherApp.exe")

The AppDomain class exposes an instance ExecuteAssembly method that enables executing the specified assembly within an ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.