国产探花免费观看_亚洲丰满少妇自慰呻吟_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 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 阳城县| 北辰区| 龙州县| 黎川县| 土默特左旗| 乌拉特后旗| 四平市| 伊吾县| 都兰县| 清远市| 土默特左旗| 甘洛县| 都安| 海阳市| 全南县| 兴城市| 桂东县| 甘肃省| 高要市| 甘南县| 和政县| 昭觉县| 鸡东县| 湖北省| 和林格尔县| 三江| 股票| 漳平市| 镇安县| 建昌县| 瑞金市| 汤阴县| 博罗县| 托克逊县| 辉南县| 盖州市| 阳原县| 桦南县| 安龙县| 武强县| 福安市|