根据这个问题,
是否可以指定一个引用到另一个组件,需要特定版本,但的没有的坚持一个特定的公钥?我的直觉是没有(因为我被指定版本的猜测时,整个完全限定的程序集名称使用其中既包括版本和PKT)
Is it possible to specify a reference to another assembly, requiring a specific version but not insisting on a specific publickeytoken? My gut feel is no (since I'm guessing when versions are specified, the entire fully qualified assembly name is used which includes both version AND pkt)
所以,如果我有这样的场景:
So if I have this scenario:
a的V1.0(签名) 组件B的1.0版,需要组件A V1.0
v1.0 of Assembly A (unsigned) v1.0 of Assembly B that requires v1.0 of Assembly A
我可以,没有源$ C $ C,重新签署组件(通过反汇编+ ILASM),所以我有急症室的工作版本; B,签约?
Can I, without the source code, re-sign the assemblies (via ildasm + ilasm) so I have working versions of A & B, signed?
所以,这不的非常的回答这个问题,但解决了我潜在的场景,其中移动一对未签名程序集签名的版本,而维持特定版本的要求。事实证明,当你重新签署程序集,ILASM之前,你可以打开.il内,并采取靠近顶部的外观,并添加了特定的公钥的引用,象下面这样:
So this doesn't quite answer the question, but solved my underlying scenario with moving a pair of unsigned assemblies to signed versions while maintaining the specific version requirement. It turns out that when you're re-signing the assemblies, before you ilasm them, you can open up the .il and take a look near the top and add the specific publickeytoken for the references, like below:
// Metadata version: v2.0.50727
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 2:0:0:0
}
.assembly extern My.Assembly
{
.publickeytoken = (3E 5D C7 B6 5B C4 C7 0E ) // .z\V.4..
.ver 1:0:0:0
}
.assembly extern System.Core
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 3:5:0:0
}
在编译时,一切都应该按预期工作:)
When compiled, everything should work as expected :)
上一篇:从广播接收器开始活动接收器
下一篇:Graph Excel REST API - Azure AD 2.0 Endpoint - 是否支持 OneDrive Personal?API、Azure、REST、Graph