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
- Does C# support multiple Inheritance ?
- What is Process ID ?
- How do I make a DLL in C# ?
- How many ways you can pass values to Windows Services ?
- Can we use "continue" statement in finally block ?
- What is nullable type in c# ?
- Difference between the Debug class and Trace class ?
- What is lock statement in C#
- What are dynamic type variables in C#
- What is the difference between is and as operator in C#?
- What are circular references in C#?
- What are the differences between events and delegates in C#
- Explain the types of unit test cases in C#?
- How many types of comments are there in C#?
- What are the various ways to pass parameters to a method in C#?
- What does assert() method do in c#
- What is literals in C# - Constants and Literals
- What is the use of goto statement in C#
- How can JIT code be faster than AOT compiled code
- Why events have no return types in .NET
- What's the difference between a static method and a non-static method in C#
- What's a weak reference c#?
- What is C# equivalent of the vb.net isNothing function
- What are indexers in C#
- What are generics in c#