签约pre-构建组件组件、pre

2023-09-04 04:28:29 作者:伊人笑

在我经过的IL挖,希望有人之前已经遇到了这个问题:

Before I go digging through the IL, hopefully someone has run into this issue before:

尝试登录第三方组件(在此情况下,最新的HtmlAgilityPack)。我以前没有问题,做到了这一点。这样做一般的反汇编=> ILASM,但是当我去用我的新签名的程序集,Visual Studio中抱怨它不能枚举资源的可执行文件。可能是什么原因?

Trying to sign a third-party assembly (in this case, the latest HtmlAgilityPack). I've done this before with no issues. Doing the usual ildasm => ilasm, but when I go to use my newly-signed assembly, Visual Studio complains it "cannot enumerate resources in the executable". What might cause this?

推荐答案

我以前也干过。如果它只是管理,一次通过Mono.Cecil能做到和Mono.Security可以做到这一点。

I've done it before too. If it's managed only, one pass through Mono.Cecil and Mono.Security can do it.

如果你在赶时间,拆解与ILDASM,公钥声明添加到生成的文件的.il(这是一个漫长的文本文件,引用的语法拆卸签名的程序集),并重新编译与ILASM。不要忘了重新链接资源与/res:assemblyname.res。

If you're in a hurry, disassemble with ildasm, add the public key declaration to the resulting .il file (it's a long text file, reference a disassembled signed assembly for syntax), and recompile with ilasm. Don't forget to relink resources with /res:assemblyname.res.