第一步,产生Key
you can generate one with the strong name utility (sn.exe).
In Visual Studio .NET Tools, at the prompt, use the -k flag with sn.exe to specify an output file for your key pair. Key pair files usually have a .snk extension. An example follows:
sn –k myKey.snk
第二步,创建强命名程序集
In Solution Explorer, open the AssemblyInfo file for your project. Verify that the version number has been set for your assembly. This is specified in the AssemblyVersion attribute as shown in the following example:
Visual C#
[assembly: AssemblyVersion("1.0.1.1")]
[assembly: AssemblyKeyFile("..//..//myKey.snk")]
第三步,将程序集安装到GAC中
Run gacutil.exe with the /i option to specify the assembly to be installed. The following code example demonstrates how to install an assembly named myAssembly.dll to the Global Assembly Cache:
gacutil /i mypath/myAssembly.dll