重定向程序集绑定到一个自定义的/无符号的DLL自定义、绑定、符号、重定向

2023-09-03 15:36:12 作者:童话破灭。

最根本的问题是我想调试一些第三方code,看看它是如何工作的,所以我可以取代它的一部分。

The basic problem is I want to debug some 3rd party code to see how it works so I can replace part of it.

反正是有重定向绑定,这样就不会使用DLL在GAC而是我编译,而不是复制(这将是无符号或有不同的公钥)。

Is there anyway to redirect the binding so that it will not use the dll in the GAC but instead the copy I compiled instead (which will be either unsigned or have a different public key).

有关具体产品asp.net mvc的,其原因是在GAC中的dll进行了优化复制和不正确匹配与源$ C ​​$ c。在微软的源服务器。

The specific item in question is asp.net mvc, the reason is the copy of the dll in the gac has been optimised and does not match up correctly with the source code in Microsoft's source server.

微软已经发布了源asp.net mvc的,所以我可以下载并编译DLL自己,但很明显,我无法登录与他们的主要的DLL,我可以用我自己的密钥签名,但随后将有一个不同的公钥标记。

Microsoft have released the source for asp.net mvc so I can download it and compile the dll myself, but obviously I cannot sign the dll with their key, I can sign it with my own key but then it will have a different public key token.

简单的答案是引用我的DLL在我的应用程序,并重新编译我的应用程序,但我也不得不重新编译所有其他第三方DLL引用asp.net mvc的(例如,mvccontrib)。

The simple answer would be to reference my dll in my application and re-compile my application, but then I also have to recompile every other 3rd party dll that references asp.net mvc (eg, mvccontrib).

推荐答案

您可以调整签名验证的的 SN.EXE工具。

You can tune signing verification with the SN.EXE tool.

sn -Vr assembly

注销原装配在GAC然后把自己在节目中的文件夹,并使用SN来跳过验证。

Unregister the original assembly from the GAC then put your own in the program's folder and use SN to skip verification.

 
精彩推荐