Udostępnij za pośrednictwem


.NET Framework Assembly Unification Overview

The .NET Framework consists of a version of the common language runtime and about two dozen .NET Framework assemblies that make up the type library. These .NET Framework assemblies are treated by the runtime as a single unit. For example, version 1.0 of the .NET Framework consists of the runtime version 1.0.3705 and .NET Framework assemblies version 1.0.3300.0. An application or component that supports a specific version of the .NET Framework works with the shipping version of the runtime and the shipping version of the .NET Framework assemblies.

By default, the runtime loads only those .NET Framework assemblies that belong to the runtime version that is loaded in a process. When an application is launched, all references to types in code run by the runtime are directed to .NET Framework assemblies with the same version number as the runtime that is loaded in a process. This unification of .NET Framework assemblies prevents the runtime from loading assemblies from different versions of the .NET Framework unless the runtime is specifically instructed to do so.

Assembly Unification and Components

The application determines which version of the runtime it uses. The unification process includes any components an application may use. An application can redirect a component it uses to run with a particular version of the runtime. Components compiled with one version of the runtime could be redirected to use another version.

In the following illustration , the application MyApp uses two components, Comp A and Comp B. MyApp and Comp A were built with runtime version 1.0, so they contain static references to runtime version 1.0. Component Comp B contains a static reference to a .NET Framework assembly that shipped with runtime version 1.1, but because of unification, is redirected to run using the .NET Framework assembly that shipped with runtime version 1.0.

Assembly unification can redirect assembly binding

Unify

Applications can override this default behavior by providing binding redirection information in the application configuration file for any assembly. These overrides redirect the runtime to use a specific version of a .NET Framework assembly without affecting how other .NET Framework assemblies are loaded. For more information, see Assembly Binding Redirection.

Note

Version 1.0 .NET Framework assemblies are not unified. The only way to instruct the runtime to use a .NET Framework assembly that is not version 1.0 is to create a configuration file that contains the appliesTo attribute in the <assemblyBinding> element. For more information about redirecting version 1.0 .NET Framework assemblies, seeTargeting a .NET Framework Version.

See Also

Concepts

Determining Which Version of the Runtime to Load

Assembly Binding Redirection

Other Resources

Side-by-Side Execution