How to deploy assembly in GAC
An assembly must have a strong name to be installed in the global assembly cache (GAC) . 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.
Ways to deploy an assembly are as follows:
- MSI installer
- CAB archive
- XCOPY command
MSI installer is an installer package file format of windows. It comes from the program's original title, Microsoft Installer , which has since changed to windows installer.
Create a setup project.
- Right click on the installer project and go to view --> file system
- Right click in the left pan and add global assembly cache folder
- Click on the GAC folder and then in the right pane, right click and add assembly or project output
(make sure all is strong named before adding otherwise the installer will fail).
CAB archive is a cabinet (.cab) file which is used to organize installation files that are copied to the user's system. Using the Win32 Software Development Kit compression tool or the Visual Studio deployment tool, you can compress a file or a directory of files. The resulting cabinet (.cab) file can then be deployed or downloaded. A compressed file can be downloaded significantly faster than an uncompressed file. Once you have created cabinet files, you can reference them by specifying their location using the < codeBase > tag in a configuration file.
XCOPY command is a simple DOS command method of deployment . It copies the application directory and any subdirectories to the target machine. Using XCOPY command method is not for complex deployment. It allows copying the current website to another local or remote location. Also it simplifies the deployment
and the maintenance of ASP.NET sites because you make no registry entries.
How to Assembly versioning
Whenever a new .NET assembly is created in the .Net environment, a file named AssemblyInfo is created that contains attributes used to define the version of the assembly during compilation. All versioning of assemblies that use the common language runtime is done at the assembly level. The AssemblyVersion attribute assigns the version number of the assembly, and this is embedded in the manifest. More about.... How to Assembly versioning