How to create a public assembly in GAC

王朝c#·作者佚名  2006-12-17
宽屏版  字体: |||超大  

How to Create a public Assembly and Install it in the GAC(Global Assembly Cache)

Step1: Create a DLL Assembly( win class library project).

Step 2: Create a strong name for the Assemly. Sn – k keyName.snk

Setp3: Assign the key file to the assembly. In the AssemblyInfo.cs, change the Assembly:AssemblyKeyfile(“..\\..\\keyfile.snk”);

Step4: install the assembly to the GAC. Gacutil –I assemblyName.dll or drag and drop to c:\\winnt\\assembly

Step5: Uninstall a assembly from GAC, use gacutil /u (/ul, /uf) assemblyName. (Not need .DLL extention)

Step6: How to use the assembly in GAC. First, using the namespace of the assembly namespace, secondly, directly use the class in the assembly.

Need to Improve

1 why system mention: Not fond snk file when I directly use “keyName.snk” instead of “..\\..\\keyName.snk”

2 How to uninstall a assembly because always “uninstall fail because other applications use it”

3 how to reference the assembly in GAC. After I add a assembly to GAC, but I can’t reference it .

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有