3.3. Execute an Assembly in a Different Application Domain

Problem

You need to execute an assembly in an application domain other than the current one.

Solution

Call the ExecuteAssembly or ExecuteAssemblyByName method of the AppDomain object that represents the application domain, and specify the file name of an executable assembly.

How It Works

If you have an executable assembly that you want to load and run in an application domain, the ExecuteAssembly or ExecuteAssemblyByName method provides the easiest solution. The ExecuteAssembly method provides four overloads. The simplest overload takes only a String containing the name of the executable assembly to run; you can specify a local file or a URL. Other ExecuteAssembly overloads allow you ...

Get Visual Basic 2008 Recipes: A Problem-Solution Approach 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.