Previous Topic: Strong NamingNext Topic: ADO.NET and Data Provider Classes


Local and Global Assembly Cache

All assemblies and other resources required by the .EXE are generally required to be in the local assembly cache or the global assembly cache. It is important to note that the PATH variable is not used.

When a .NET application begins execution, the CLR begins the process of probing (loading) the DDLs required by the application. The order of probing is (1) the GAC (2) the directory where the .EXE is located and (3) the directory or directories specified by the privatePath attribute in the application configuration file.

Local Assembly Cache

The local assembly cache is the application root directory plus the subdirectories that are specified in the privatePath attribute.

The application root directory is the directory where the .EXE file is located. If the application has configuration files, they must be located in this directory.

One or more subdirectories under the application root directory may contain additional assemblies or resources required by the application. Specifying the directory or list of directories in the privatePath attribute causes them to be searched during probing.

Global Assembly Cache

The global assembly cache (GAC) is a single location on the system where you can share assemblies. The GAC stores assemblies in a set of directories located under the <windows-root>\assembly directory, but this set of directories appears as a single directory in Windows Explorer.

The GAC can only contain assemblies. Before you can store an assembly in the GAC, the assembly must be public and strongly named. If an assembly is present in the local assembly cache and the GAC, the copy stored in the GAC is used.

Note: You cannot store common data or configuration files in the GAC.

Assemblies loaded from network shares are treated differently than assemblies loaded from local drives. The assemblies loaded from network shares are considered less trusted. Security settings may require changing in order for applications to be executed from a network share.