Dotnet Tutorial Home
- Overview of .Net Framework
- .Net Components:
- CLR (Common Language Runtime)
- Steps to Run a program in CLR
- GAC (Global Assembly CACHE)
- Strong Name in .Net Assembly
- ILDASM: Intermediate Language Disassembler in .Net
- Custom Attributes in .Net
- Application Domain in .Net
- Code Access Security in .Net
- Type System in .Net -1
- Type System in .Net -2
- Reflection: Inspection of a Type\'s Metadata
- Introduction to Generics
- Generic Classes and Methods
- Generic Methods in .Net 2.0
- Overview of Inheritance in Generics classes
- Connection pooling in .Net Applications
- Deployment in .Net
- Members (3606)
- Member Articles ( 33 )
- Discussion (409)
- Q & A ( 3 )
- - Ask Question
- - Questions
- - Unanswered Questions
- Source Code (0)
- Articles (71)
- Blogs (47)
- Jobs (0)
- Components (2)
- Books (70)
- Websites (43)
- News (192)
Strong Name is similar to GUID (It is supposed to be unique in space and time). In COM components. Strong name is only needed when we need to deploy assembly in GAC. Strong names help GAC to differentiate between two versions. Strong names use public key cryptography (PKC) to ensure that no one can spoof it. PKC use public key and private key concept. Following are the step to generate a strong name and sign an assembly:
Step1: Go to “Microsoft Visual Studio 2005” >>Visual Studio Tool>> Visual Studio Command prompt. This wills popup the command prompt for you.
Step2: After the command prompt run the strong tool from there
Sn.exe –k “c:\test.snk”
Here k: the key specifies that we want to generate the key.
test.snk: This file contains the key that is generated by the sn.exe tool
Step3: This will create the file at the following location. When you open the file that has been generated by the strong name tool. This is not a readable format because of security reasons.
Step4: Once the strong name key/value pair is generated using the strong name utility. We need to assign it to the project.
Step5: This will assign the strong name to this project. Then compile the project again to reflect the changes. The Strong Name is needed to insert the assembly into the GAC.
Add/Remove an assembly from GAC:
Here you can use other .Net tool to put the assembly in the GAC i.e. gacutil.exe
Go to “Microsoft Visual Studio 2005” >>Visual Studio Tool>> Visual Studio Command prompt >> gacutil.exe – i (assembly_name)
where assembly_name is the DLL name of the project.
To remove the assembly run this command. gacutil.exe – u (assembly_name)