开发者

Dotfuscator and types from merged assemblies

With Dotfuscator Professional V4.8 (by PreEmptive Solutions), is it possible to make a public type from a merged (aka linked) non-primary assembly a public type of the merged assembly?

That is, suppose assembly A has a public type called Foo, and assembly B has some public method with a signature that includes type Foo. After merging A and B into C, with B as the primary assembly, I'd like Foo to be a public type of C.

It seems that dotfuscator a开发者_如何学Clways makes type Foo internal to C.

  • I've tried adding [System.Reflection.Obfuscation(Exclude=true)] to type Foo, but it appears to have no effect.
  • I don't care that the new type will be incompatible with the type from the original assembly.


Note: I work on the Dotfuscator team.

This should not be happening. I just made 2 small examples and could not reproduce the behavior you mention. My basic setups were

Tester.exe (Primary Assembly, both merged into out.exe)
  References Library
  public class Program { public void Method(Foo foo) {} }
Library.dll
  public class Foo {}

and

Tester.exe (Primary Assembly, all 3 merged into out.exe)
  References LibraryA & LibraryB
LibraryA.dll
  public class Foo {}
LibraryB.dll
  References LibraryA
  public class C { public void Method(int x, Foo foo) {} }

In both cases, Foo remains public.

The behavior you are describing is often what users want to happen, but we do not knowingly change any accessibility levels because of merging.

Please let me know if your setup was somehow different than mine. I'd be interested to see your exact repro. If you're able, please send it to support@preemptive.com and reference this thread. Thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜