Select the product you need help with
How to install an assembly in the .NET Framework global assembly cacheArticle ID: 910355 - View products that this article applies to.
For a Microsoft Visual Basic .NET version of this article, see 315682
(http://support.microsoft.com/kb/315682/
)
.
For a Microsoft Visual C++ 2005 and Visual C++ .NET version of this article, see 815807
(http://support.microsoft.com/kb/815807/
)
.
For a Microsoft Visual C# .NET version of this
article, see
815808
(http://support.microsoft.com/kb/815808/
)
. On This PageSUMMARYThis article describes how to install an assembly .dll file in the Microsoft .NET Framework global assembly cache. To do this, you can use the Microsoft .NET Framework Software Development Kit (SDK) Global Assembly Cache tool. An assembly must have a strong name to be installed in the global assembly cache. This article describes how to create an
assembly that has a strong name by using Microsoft Visual Studio 2005. Additionally, this article describes how to verify that the assembly is installed in the global assembly cache. To accomplish this task, you must have Administrator rights to the computer where
the shared assembly is installed. Additionally, you must install the .NET Framework SDK. INTRODUCTIONThis step-by-step article describes how to create an
assembly that has a strong name by using Visual Studio 2005. Additionally, this
article describes how to install an assembly .dll file in the .NET
Framework global assembly cache. To do this, you can use the .NET Framework SDK
Global Assembly Cache tool. You can also use the Global Assembly Cache tool to verify that the assembly is installed in
the global assembly cache. MORE INFORMATIONThe global assembly cacheThe .NET Framework global assembly cache is a code cache. The global assembly cache is automatically installed on each computer that has the .NET Framework common language runtime installed. Any application that is installed on the computer can access the global assembly cache. The global assembly cache stores assemblies that are specifically designated to be shared by several applications on the computer. Component assemblies are typically stored in the C:\WINNT\Assembly folder.Note Only install an assembly in the global assembly cache when you must share the assembly. Unless sharing an assembly is explicitly required, we recommend that you keep assembly dependencies private and that you locate the assembly in the application directory. Additionally, you do not have to install an assembly in the global assembly cache to make the assembly available to Microsoft Component Object Model (COM) interop or to unmanaged code. An assemblyAn assembly is a fundamental part of programming with the .NET Framework. An assembly is a reusable, self-describing building block of a .NET Framework common language runtime application.An assembly contains one or more code components that the common language runtime executes. All types and all resources in the same assembly form an individual version of the unit. The assembly manifest describes the version dependencies that you specify for any dependent assemblies. By using an assembly, you can specify version rules between different software components, and you can have those rules enforced at run time. An assembly supports side-by-side execution. This enables multiple versions to run at the same time. Strong-name signingAn assembly must have a strong name to be installed in the global assembly cache. A strong name is a globally unique identity that cannot be spoofed by someone else. By using a strong name, you prevent components that have the same name from conflicting with each other or from being used incorrectly by a calling application. Assembly signing associates a strong name together with an assembly. Assembly signing is also named strong-name signing. A strong name consists of the following information:
You can sign an assembly by using the options on the Signing tab of the Project Designer in Visual Studio 2005. In Visual Studio 2005, the key file must be stored in the project folder on the local computer. Visual Studio 2005 supports only the following file formats:
RequirementsYou must meet the following requirements before you install an assembly in the global assembly cache:
How to install an assembly in the global assembly cacheThis method is based on how to create an assembly by using Visual Studio 2005. To create an assembly that can be shared by multiple applications, the shared assembly must have a strong name. Additionally, the shared assembly must be deployed in the global assembly cache.To create a small Microsoft Visual C# assembly that has a strong name and to install the compiled .dll file in the global assembly cache, follow these steps:
How to verify that the assembly is installed in the global assembly cacheYou can use the Global Assembly Cache tool to verify that the assembly is installed in the global assembly cache. To do this, follow these steps:
REFERENCES
For more information about how to create an assembly that has a strong name in the .NET Framework SDK, click the following article number to view the article in the Microsoft Knowledge Base:
302340 For more information about the global
assembly cache, visit the following Microsoft Developer Network (MSDN) Web sites:
(http://support.microsoft.com/kb/302340/
)
How
to create an assembly with a strong name in .NET Framework SDK
Assemblies overview http://msdn2.microsoft.com/en-us/library/k3677y81(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/k3677y81(vs.71).aspx)
Creating assemblies http://msdn2.microsoft.com/en-us/library/b0b8dk77(VS.80).aspx
(http://msdn2.microsoft.com/en-us/library/b0b8dk77(VS.80).aspx)
Programming with assemblies http://msdn2.microsoft.com/en-us/library/8wxf689z(VS.80).aspx
(http://msdn2.microsoft.com/en-us/library/8wxf689z(VS.80).aspx)
Working with assemblies and the global assembly cache http://msdn2.microsoft.com/en-us/library/6axd4fx6(VS.80).aspx
(http://msdn2.microsoft.com/en-us/library/6axd4fx6(VS.80).aspx)
How to install an assembly into the global assembly cache http://msdn2.microsoft.com/en-us/library/dkkx7f79(VS.80).aspx
(http://msdn2.microsoft.com/en-us/library/dkkx7f79(VS.80).aspx)
Global assembly cache http://msdn2.microsoft.com/en-us/library/yf1d93sz(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/yf1d93sz(vs.71).aspx)
Global Assembly Cache tool (Gacutil.exe) http://msdn2.microsoft.com/en-us/library/ex0ss12c(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/ex0ss12c(vs.71).aspx)
PropertiesArticle ID: 910355 - Last Review: November 22, 2007 - Revision: 1.9 APPLIES TO
|


Back to the top








