What is the purpose of Strong Name in COM Components of .NET?

Strong names in COM components are used to provide identity for an assembly when deployed in global assembly cache.



The same assembly can have multiple versions of it. To identify each assembly in unique way, you define and use strong names. Characteristics of strong names are mentioned below:
" Strong name provides unique name for each version of the assembly by using public key cryptography which uses both public key and private key pairs.
" Strong name ensures that the assembly version is reliable and it is published by the same publisher who created this assembly.
" Strong name ensures better integrity using the digital signatures and the related certificates.
" Strong name of an assembly encompasses a text, version number, public key and the digital signature used to sign the certificate.

You can generate a strong name by following the steps mentioned below:
" In the menu, choose Microsoft Visual Studio <Version Number>
" Navigate to Visual Studio Tools and select Visual Studio Command Prompt
" In the command prompt, run sn.exe using the following command:
sn.exe -k "c:\sample.snk"
" If the executable runs successfully, you will receive the message "Key pair written to c:\sample.snk"
" Now the sample.snk is successfully generated and you can try to read it in notepad but it will not be in human readable form
" Next step you have to perform is to sign your project with this sample.snk file
" In your Microsoft Development Environment, click on Project menu and click on the properties for example ClassLibrary1 Properties in the menu
" In the page that appears, select the radio button corresponding to "Use a key file" entry.
" In the text box associated with it, browse and select the sample.snk file
" Now the assembly pertaining to ClassLibrary1 is signed with the strong name generated in sample.snk

| How do you prevent a class from overriding in .NET? | How are classes related to objects in .NET Application | How are Delegates different from Events in .NET? | How are system exceptions different from application exceptions in .NET? | How are Value Types different from Reference Types in .NET? | How can a finalize method be suppressed in .NET? | How can you call Stored Procedure in ADO.NET? | How can you force Dispose method to be called automatically in .NET? | How do you call a Base Class Constructor from Derived Class Constructor in .NET? | How do you connect your VB.NET application to SQL Server? | How do you implement Cloning in .NET? | How do you implement Façade Design Pattern in .NET? | How do you implement MVC Pattern in ASP.NET? | How do you install .NET Assembly in GAC? | How is shadowing different from overriding in .NET? | How to prevent a particular .NET DLL from being decompiled? | Illustrate Delay Signing Process of an Assembly in .NET? | What are Reference Types in .NET? | What are the advantages of C#? | What are the advantages of VB.NET? | What are the differences between Namespace and Assembly in .NET? | What are the similar features between class and structure in .NET? | What are Value Types in .NET? | What do you mean by mixed mode authentication in .NET? | What do you mean by Satellite Assembly in .NET? | What do you mean by shadowing in .NET? | What is CTS in .NET? | What is ILDASM in .NET? | What is Managed Code in .NET? | What is Manifest in .NET? | What is MSIL in .NET Framework? | What is the importance of finalize method in .NET? | What is the need for Visitor Pattern in C#? | What is the purpose of bindingRedirect tag in web.config file of .NET? | What is the purpose of CodeDom in .NET? | What is the purpose of dispose method in .NET? | What is the purpose of Ngen.exe in .NET? | What is the purpose of Strong Name in COM Components of .NET? | What is the purpose of virtual keyword in .NET? | What Object Oriented Principles can be incorporated in .NET Application? |


“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”

| Privacy Policy for www.dotnet-guide.com | Disclosure | Contact |

Copyright - © 2004 - 2024 - All Rights Reserved.