如何使一个你没有源代码的DLL文件变为强命名的(Strong Name)
来源:互联网 发布:硬盘检测软件 编辑:程序博客网 时间:2024/05/01 21:15
有时候你会需要一个DLL是强命名的,比如你想把这个文件放到GAC里面。如果这是一个第三方的DLL,你没有源代码,这会是一件比较麻烦的事情。有一个方法可以解决这个问题。
在VS.NET的命名行窗口下,输入如下的代码。
1 ,生成一个KeyFile
sn -k keyPair.snk
2, 得到程序集的MSIL
ildasm SomeAssembly.dll /out:SomeAssembly.il
3 ,为了避免冲突,把原来的DLL文件改名
ren SomeAssembly.dll SomeAssembly.dll.orig
4 , 使用导出的MSIL和刚创建的KeyFile生成一个新的的DLL文件。
ilasm SomeAssembly.il /dll /key= keyPair.snk
Where do these tools live
这些工具都在哪里?
- C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/ilasm.exe
- C:/Program Files/Microsoft Visual Studio 8/SDK/v2.0/Bin/ildasm.exe
- C:/Program Files/Microsoft Visual Studio 8/SDK/v2.0/Bin/sn.exe
From:http://msdn.microsoft.com/zh-cn/dd552271.aspx
Solution of the assigning the strong name to the third part DLL by using following command on visual studio command prompt.
E.g. Lets say the name of the third party DLL is myTest.dll.
Step 1: Dis-assemble the assembly
ildasm myTest.dll /out:myTest.il
Step 2: Re-Assemble using your strong-name key
ilasm myTest.il /res:myTest.res /dll /key:myTest.snk /out:myTestSN.dll
This code work perfectly to assign strong name.
for verification you can use following command,
sn -vf myTestSN.dll
If the 3rd party assembly is delay signed, you can just add it to the Skip Verification list:
SN -Vr YourAssemblyName
So CLR will no longer validate this assembly while loading it.
- 如何使一个你没有源代码的DLL文件变为强命名的(Strong Name)
- 如何使一个你没有源代码的DLL文件变为强命名的(Strong Name)
- 如何使一个你没有源代码的DLL文件变为强命名的DLL
- 没有源代码的DLL文件变为强命名的(Strong Name)
- 如何创建强命名程序集(Strong Name Assembly
- 强名称的原理(strong name)
- 关于.Net的强名称(Strong Name)
- 为没有源码的DLL文件添加强名称
- 为没有源码的DLL文件添加强名称
- 为没有源码的DLL文件添加强名称
- 为没有源码的DLL文件添加强名称
- 为没有源码的DLL文件添加强名称
- 为没有源码的DLL文件添加强名称
- 如何调试带有源代码的dll文件
- 如何调试具有源代码的dll文件
- 一个windows应用程序内部到底有没有DLL文件的代码呢???它是如何调用DLL的???
- 强名介绍Strong Name
- 将COM签发成具有强名称(Strong Name)的结果程序集(Assembly)
- 实在的50句话
- jsp 指令与动作 标签 include
- 我的xp超级用户登录时不见了?怎么恢复?
- 介绍4---memory和client/server
- VC快键
- 如何使一个你没有源代码的DLL文件变为强命名的(Strong Name)
- csdn 上的第一篇文章!
- Canon MF8100 Series Printer driver install on Windows 7
- c# 中form调用并操作web脚本
- 逆向工程日记2--WINDOWS优化大师
- 学习C++的50条警言
- 基本概念:堆与堆栈
- 参数初始化表
- windbg.txt