简体   繁体   English

Dotfuscator和合并程序集中的类型

[英]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? 使用Dotfuscator Professional V4.8(由PreEmptive Solutions提供),是否可以将合并(又称为链接)非主程序集中的公共类型设为合并程序集的公共类型?

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. 也就是说,假设程序集A具有称为Foo的公共类型,而程序集B具有某些公共方法,其签名包括类型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. 在将A和B合并到C中并将B作为主要程序集之后,我希望Foo成为C的公共类型。

It seems that dotfuscator always makes type Foo internal to C. 似乎dotfuscator总是使Foo类型成为C的内部。

  • I've tried adding [System.Reflection.Obfuscation(Exclude=true)] to type Foo, but it appears to have no effect. 我尝试添加[System.Reflection.Obfuscation(Exclude = true)]来键入Foo,但它似乎没有效果。
  • 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. 注意:我在Dotfuscator团队工作。

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. 在这两种情况下,Foo都保持公开状态。

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. 如果可以,请将其发送至support@preemptive.com并引用此线程。 Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以从流程中卸载程序集或类型? - Is it possible to unload assemblies or types from a Process ? 使用动态加载的程序集中的类型将XML文档反序列化为.NET对象 - Deserialise XML Documents to .NET Objects with types from dynamically loaded assemblies 在所有装配中查找类型 - Find Types in All Assemblies 合并程序集中的.NET类型定义(ILMerge) - .NET type definitions in merged assemblies (ILMerge) 如何使Dotfuscator从命令行工作? - How to get Dotfuscator to work from command line? 使dotfuscator识别针对第三版本的不同版本构建的两个程序集引用的是同一程序集? - Making dotfuscator recognize two assemblies built against different versions of a third assembly are referencing the same assembly? C#在2个组件中输入质量 - C# types quality in 2 assemblies .NET 中程序集的标记类型是什么? - What are the marker types for assemblies in .NET? 反序列化跨程序集移动的类型 - Deserialize types moved across assemblies 如何从2个不同的程序集加载相同的插件,并在两者之间序列化和反序列化类型? C#.net - How to load same plugins from 2 different assemblies, and serializing and deserializing types between the two? C# .net
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM