国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

HOW TO: create an Assembly with a Strong Name

2024-07-21 02:16:42
字體:
來源:轉載
供稿:網友


收集最實用的網頁特效代碼!

how to: create an assembly with a strong name

--------------------------------------------------------------------------------
the information in this article applies to:

microsoft visual studio .net beta 2

--------------------------------------------------------------------------------

in this task
summary
prerequisites
creating an assembly with a strong name
references


summary
assemblies can be assigned a cryptographic signature called a strong name, which provides name uniqueness for the assembly and prevents someone from taking over the name of your assembly (name spoofing). if you are deploying an assembly that will be shared among many applications on the same computer, it must have a strong name. this document describes how to create an assembly with a strong name.

back to the top

prerequisites
this article assumes that you have installed and are familiar with visual studio .net.

back to the top
creating an assembly with a strong name
use the strong name tool (sn.exe) that comes with the .net framework software development kit (sdk) to generate a cryptographic key pair.

the following command uses the strong name tool to generate a new key pair and store it in a file called testkey.snk:


sn -k testkey.snk
add the proper custom attribute to your source for the compiler to emit the assembly with a strong name. which attribute you use depends on whether the key pair that is used for the signing is contained in a file or in a key container within the cryptographic service provider (csp). for keys that are stored in a file, use the system.reflection.assemblykeyfileattribute attribute. for keys that are stored in the csp, use the system.reflection.assemblykeynameattribute attribute.

the following code uses assemblykeyfileattribute to specify the name of the file that contains the key pair.

note : in microsoft visual basic, the assembly level attributes must appear as the first statements in the file.

visual basic .net code
imports system
imports system.reflection

<assembly:assemblykeyfileattribute("testkey.snk")>
c# code
using system;
using system.reflection;

[assembly:assemblykeyfileattribute("testkey.snk")]
back to the top
references
for more information about the strong name tool (sn.exe), see the following microsoft .net framework tools web site:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfstrongnameutilitysnexe.asp
for more information about the .net framework sdk, see the following microsoft web site:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/nfstart/html/sdkstart.asp
for more information about global attributes, see the c# programmer's reference.

back to the top 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 林口县| 宜君县| 高碑店市| 广平县| 吉安县| 抚松县| 木兰县| 安阳县| 琼海市| 水城县| 吉林省| 洞头县| 平顺县| 临夏市| 民县| 文昌市| 静宁县| 奉化市| 稻城县| 乌海市| 香河县| 清丰县| 东光县| 沈阳市| 西昌市| 洪湖市| 陆丰市| 张北县| 咸阳市| 东海县| 尚志市| 孝义市| 丹寨县| 报价| 张家口市| 玉溪市| 稻城县| 神农架林区| 高邑县| 开原市| 华阴市|