如何使用.net中的dll文件创建强键名 [英] How to create strong key name using dll file in .net

查看:121
本文介绍了如何使用.net中的dll文件创建强键名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个Dll文件.我想使用此dll文件创建强键名.
怎么做.

我已经在cmd提示符下使用sn -k命令尝试了一些代码.
C:\ Windows \ assembly> sn -k"D:\ WebPratice \ Edraw \ Edraw \ bin \ Edraw.snk"

但是我收到以下消息.....我的dll文件是Edraw.dll
不能将"sn"识别为内部或外部命令,可运行的程序或批处理文件

请任何人回答.......请给我帮助.

谢谢与问候
Mukesh

Hi,

I have a Dll file. I want to create strong key name using this dll file.
how can do that.

I have tried some code using sn -k command on cmd prompt.
C:\Windows\assembly> sn -k "D:\WebPratice\Edraw\Edraw\bin\Edraw.snk"

but i got below message.....My dll file is Edraw.dll
''sn'' is not recongized as an internal or external command,operable program or batch file

Please any one have a answer.......plz help.

Thanks & Regards
Mukesh

推荐答案

你好,Mukesh,

您不能在任何命令窗口中运行sn命令..需要设置环境变量.

在Visual Studio 20xx命令提示符下运行命令.您将在开始时找到它-程序-Visual Studio 20xx-Visual Studio工具-Visual Studio 20xx命令提示符.

谢谢,
赫曼特


您还可以为项目的dll添加一个强键.例如,如果Edraw是您在VS 2008中的项目及其生成的Edraw.dll,则可以转到项目属性(即,右键单击project->属性),然后转到签名"选项卡,然后选中签名程序集"复选框.

签名程序集"复选框下方的下拉框将启用选择强名称密钥文件",然后选择新建,它将要求您输入文件名,并将Edraw.snk传递给它.如果要对文件进行密码保护,请将密码信息传递到同一对话框,否则请取消选中使用密码保护我的密钥文件"复选框.

完成了.

谢谢,
Hemant
Hello Mukesh,

you cannot run sn command in any command window.. the environment variables needs to be set.

Run the command in Visual studio 20xx command prompt. you will find it in start - programs - visual studio 20xx - visual studio tools - Visual studio 20xx command prompt.

Thanks,
Hemant


you can also add a strong key to a project''s dll. for instance if Edraw is your project in VS 2008 and its generating Edraw.dll then you can goto project properties (i.e. right click on project-> properties) then "Signing" tab, and after that check "Sign the assembly" check box.

A drop down box below "Sign the assembly" checkbox will get enable "choose a strong name key file" select New in it will ask you for file name pass Edraw.snk to it. if you want the file to be password protected pass the password information to the same dialog box otherwise uncheck the "protect my key file with a password" checkbox.

you are done.

Thanks,
Hemant


VS工具通常不包含在命令路径中,必须在命令提示符中包含VS2008二进制文件路径.
最简单的方法是:
1)开始按钮
2)所有程序
3)Microsoft Visual Studio 2008 ... Visual Studio工具... Visual Studio 2008命令提示符
然后将对这些工具进行路径设置,您可以照常进行操作.
The VS tools aren''t normally included in the command path, you must include the VS2008 binaries path in your command prompt.
The easiest way to do this is to:
1) Start button
2) All Programs
3) Microsoft Visual Studio 2008...Visual Studio Tools...Visual Studio 2008 Command Prompt
The tools will then be pathed, and you can proceed as normal.


这篇关于如何使用.net中的dll文件创建强键名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆