O'Reilly logo

Visual Basic 2008 Recipes: A Problem-Solution Approach by Rakesh Rajan, Matthew MacDonald, Allen Jones, Todd Herman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3.1. Load an Assembly into the Current Application Domain

Problem

You need to load an assembly into the current application domain at runtime.

Solution

Use the Shared Load method or the LoadFrom method of the System.Reflection.Assembly class.

NOTE

The Assembly.LoadWithPartialName method has been deprecated in .NET Framework 2.0. Instead, you should use the Assembly.Load method described in this recipe.

How It Works

Unlike with Win32, where the referenced DLLs are loaded when the process starts, the common language runtime (CLR) will automatically load the assemblies referenced by your assembly only when the metadata for their contained types is required. However, you can also explicitly instruct the runtime to load assemblies. The Load and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required