Since aspects are serialized at build time, they cannot be deserialized if the aspect type has been obfuscated. The solution is not to obfuscate any serializable type. Another solution is not to serialize aspects (see AspectConfigurationAttribute.SerializerType in PostSharp 2.0, and use the serializer MsilAspectSerializer).
There are problems when aspects are applied to generic methods and methods of generic types (the reason is that PostSharp uses reflection, based on method names, in this case, to work around bugs in the CLR).
Aspect-oriented programming is just a special case of program transformation.
If you can apply program transformations using a tool, you can do AOP easily.
Our DMS Software Reengineering Toolkit is a program transformation engine
that handles many real languages, including C, C++, Java, COBOL and even C#4.0.
发布评论
评论(4)
PostSharp 在某种程度上支持 ILMerge。请参阅http://www.postsharp.org/blog/postsharp-and-ilmerge。但是混淆的程序集存在问题。
由于方面是在构建时序列化的,因此如果方面类型已被混淆,则它们无法反序列化。解决方案是不要混淆任何可序列化类型。另一种解决方案是不序列化切面(请参阅 PostSharp 2.0 中的 AspectConfigurationAttribute.SerializerType,并使用序列化器 MsilAspectSerializer)。
将方面应用于泛型方法和泛型类型的方法时会出现问题(原因是 PostSharp 使用基于方法名称的反射,在本例中是为了解决 CLR 中的错误)。
PostSharp somewhat supports ILMerge. See http://www.postsharp.org/blog/postsharp-and-ilmerge. But there are problems with obfuscated assemblies.
Since aspects are serialized at build time, they cannot be deserialized if the aspect type has been obfuscated. The solution is not to obfuscate any serializable type. Another solution is not to serialize aspects (see AspectConfigurationAttribute.SerializerType in PostSharp 2.0, and use the serializer MsilAspectSerializer).
There are problems when aspects are applied to generic methods and methods of generic types (the reason is that PostSharp uses reflection, based on method names, in this case, to work around bugs in the CLR).
NCop 是一个受 Post Sharp 启发的 .NET 平台复合方面框架
Sheep Aspect 是受 AspectJ 启发的 .NET 平台的替代开源 AOP 工具
NCop is a composite-aspect framework for the .NET platform inspired by Post Sharp
Sheep Aspect is an alternative open source AOP tool for the .NET platform inspired by AspectJ
Spring.NET 具有 AOP 功能,这些功能在运行时编织,因此应该与混淆的程序集一起使用。
http://www.springframework.net/
文档:
http://www.springframework.net/doc-latest/reference/html/aop.html
Spring.NET has AOP features which are weaved at runtime so should work with obfuscated assemblies.
http://www.springframework.net/
Documentation:
http://www.springframework.net/doc-latest/reference/html/aop.html
面向方面编程只是程序转换的一个特例。
如果您可以使用工具应用程序转换,那么您可以轻松地进行 AOP。
我们的 DMS 软件重组工具包是一个程序转换引擎
它可以处理许多实际语言,包括 C、C++、Java、COBOL 甚至 C#4.0。
有关更多详细信息,请参阅使用 DMS 进行面向方面编程。
Aspect-oriented programming is just a special case of program transformation.
If you can apply program transformations using a tool, you can do AOP easily.
Our DMS Software Reengineering Toolkit is a program transformation engine
that handles many real languages, including C, C++, Java, COBOL and even C#4.0.
See Aspect Oriented Programming using DMS for more details.