Sdílet prostřednictvím


Assembly Placement 

For most .NET Framework applications, you locate assemblies that make up an application in the application's directory, in a subdirectory of the application's directory, or in the global assembly cache (if the assembly is shared). You can override where the common language runtime looks for an assembly by using the <codeBase> Element in a configuration file. If the assembly does not have a strong name, the location specified using the <codeBase> Element is restricted to the application directory or a subdirectory. If the assembly has a strong name, the <codeBase> Element can specify any location on the computer or on a network.

Similar rules apply to locating assemblies when working with unmanaged code or COM interop applications: if the assembly will be shared by multiple applications, it should be installed into the global assembly cache. Assemblies used with unmanaged code must be exported as a type library and registered. Assemblies used by COM interop must be registered in the catalog, although in some cases this registration occurs automatically.

See Also

Concepts

How the Runtime Locates Assemblies

Other Resources

Configuration Files
Advanced COM Interoperability
Assemblies in the Common Language Runtime