Strong Name Key

  • Thread starter Thread starter spaulsamin
  • Start date Start date
S

spaulsamin

Hello Everyone
Have nice day!!!

Please explain Strong Name key in very simple way with example and
How to create it?

Paul
 
Because your assembly name (foo.dll) may not be unique in the universe
(what's to stop me from making an assembly called "foo.dll"?), there are
times when you want to give it a strong name (for example, when you want to
install your assembly into the GAC).

This strong name consists of a public and private key and is used to
uniquely identify an assembly on your system.

You give your assembly a strong name by doing to the following:

1. Using the sn.exe tool provided with VS.NET, at a command line, you type:
sn.exe -k fullPathToTheNewKeyFileYouAreCreating
(ie. sn.exe -k c:\myKeyFile.snk)

After this a new key file will have been created. This key file has public
& private key information in it. You now need to associate that info. with
your assembly.

2. You open the AssemblyInfo.cs/.vb file and add a new entry
<Assembly:AssemblyKeyFileAttribute("sgKey.snk")>

Now, you recompile and your assembly will have a strong name associated with
it.

See: http://msdn2.microsoft.com/en-us/library/wd40t7ad(VS.80).aspx and
related links at bottom of article for more info.
 
Because your assembly name (foo.dll) may not be unique in the universe
(what's to stop me from making an assembly called "foo.dll"?), there are
times when you want to give it a strong name (for example, when you want to
install your assembly into the GAC).

This strong name consists of a public and private key and is used to
uniquely identify an assembly on your system.

You give your assembly a strong name by doing to the following:

1. Using the sn.exe tool provided with VS.NET, at a command line, you type:
sn.exe -k fullPathToTheNewKeyFileYouAreCreating
(ie. sn.exe -k c:\myKeyFile.snk)

After this a new key file will have been created. This key file has public
& private key information in it. You now need to associate that info. with
your assembly.

2. You open the AssemblyInfo.cs/.vb file and add a new entry
<Assembly:AssemblyKeyFileAttribute("sgKey.snk")>

Now, you recompile and your assembly will have a strong name associated with
it.

See: http://msdn2.microsoft.com/en-us/library/wd40t7ad(VS.80).aspxand
related links at bottom of article for more info.








- Show quoted text -

Thank you sir
 
Back
Top