c# - 使用强名称签署程序集,好的,但是如果某些第 3 方 DLL 未签署怎么办?

标签 c# gac copy-protection assembly-signing snk

我了解签署程序集背后的基本思想,但在使用 Telerik 或第 2 方 DLL 时遇到问题。 我有一个使用我自己的 2 个 .DLL 的 .exe,这些 DLL 又使用企业库 DLL 和 Telerik DLL。

我给所有项目起了一个强名称 .snk,但是在编译时编译器解释说企业库 DLL,例如,没有签名,这是有道理的。

我不想使用 te sn.exe -Vr 命令关闭验证,甚至不想延迟签署我的项目。但是,这将如何运作呢?我很感激任何见解。

最佳答案

签署/退出第三方集会很不方便,但不是火箭科学。 假设您想使用 default.snk key 签署一个未签名的 dll,例如 System.ComponentModel.Composition.dll:

打开 VS 命令提示符并 cd 到包含未签名的 dll 的文件夹

ildasm /all /out=System.ComponentModel.Composition.il System.ComponentModel.Composition.dll
ilasm /dll /key=default.snk System.ComponentModel.Composition.il
del System.ComponentModel.Composition.il

在每个适用的 VS 项目中,删除并重新添加对已签名程序集 System.ComponentModel.Composition.dll 的引用

关于c# - 使用强名称签署程序集,好的,但是如果某些第 3 方 DLL 未签署怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4244838/

相关文章:

c# - Azure 数字孪生 API 无法使用本教程中所述的 DefaultAzureCredential 身份验证方法

.net - 为什么我无法将 DLL 添加到 Windows 7 中的 GAC?

windows - 在 GAC 中注册 DLL(CMD 或 PowerShell)

c++ - 保护单个程序中的数据

licensing - 产品序列号/购买

python - 如何保护 Python 代码不被用户阅读?

c# - 从文件中读取值

c# - 如何在 C# 中搜索多个位置的直接子字符串

c# - ServiceStack.OrmLite : Reading back a TimeSpan using Untyped API results in InvalidCastException

.net - 如何使发布者策略文件重定向程序集请求