Strong name and gacutil command in .Net
Strong name:
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:
gacutil command:
The Global Assembly Cache tool
allows you to view and manipulate the contents of the global assembly cache and
download cache.
Gacutil.exe is
considered to be a development tool. Because of this it is only contained in the
.NET SDK but not in the regular redistributable. Visual Studio comes with the
SDK, so all Visual Studio users have it installed.
Using strong name and gacutil command:
Step1: Go to
“Microsoft Visual Studio 2010” >>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
D:\>cd avi
D:\avi>sn –k
key.snk
Here k: the key specifies that we
want to generate the key.
key.snk: This file contains the
key that is generated by the sn tool

Note- Microsoft use symmetric algorithm, RSA2
Step3: Attached the key
|
using System;
using System.Reflection;
[assembly:AssemblyKeyFile("key.snk")]
public class show
{
public string
show_employee()
{
return "Hello...";
}
}
|
Write above code on notepad and save it, where key.snk saved. Then make DLL like

Step4: Mapped DLL in Assembly folder

Step5:
Write code on notepad and make EXE
file in different folder and access show.dll file
|
using System;
public class check
{
public static void
Main()
{
show
s = new show();
Console.WriteLine(s.show_employee());
}
}
|

Step6:
execute check
exe….
|