简体   繁体   中英

Making dotfuscator recognize two assemblies built against different versions of a third assembly are referencing the same assembly?

We have a .Net application AppA that includes assemblies LibA and LibB.

LibB also references LibA; it was built some time ago and put in our package repository, so it was built against an older version of LibA than that included directly in AppA. None of the libraries are strongly named.

When we run AppA just as built, only the latest version of LibA is used; all the references to LibA from LibB happily use the latest version rather than the version LibB was built against.

However, when we put these assemblies in Dotfuscator, Dotfuscator treats the references to LibA from LibB as though they reference a completely different assembly then the LibA we pass into Dotfuscator. Therefore, in the obfuscated application, references from LibB to LibA are not updated to reflect the obfuscation of LibA, and so fail at runtime.

The workaround for this is to make sure all our assemblies are built against exactly the same version of our other assemblies. This fixes the obfuscated application, but it kind of defeats the purpose of our package management strategy, which is supposed to allow each of our libraries to evolve at its own pace. It's hard to scale with the large number of packages we develop.

Am I missing some switch or setting in Dotfuscator (we are using version 4.8 of the commercial version, but can upgrade) that will make it resolve assembly references only by name, the same way that .Net will at runtime, so the obfuscation will work the way we expect?

Disclaimer, I am an employee of PreEmptive Solutions, developers of Dotfuscator.

Version 4.33.0 released today (11/20/2017) contains a fix for this issue. In addition Assembly Binding Redirection can now be used to be more explicit about what assemblies to resolve.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM