-->

Suggestions for open source aspect-oriented librar

2020-07-24 15:42发布

问题:

Any suggestions for open source aspect-oriented library for c#. Thanks

回答1:

Post Sharp



回答2:

Spring.NET



回答3:

I am using Castle Windsor and Dynamic Proxy, which together provide a simple way to apply your standard AOP method interception through external XML configuration.

If you have more advanced AOP needs, Aspect# might be useful (also relies on Dynamic Proxy) - but I have found that Windsor fulfills my needs perfectly.

Please note that Dynamic Proxy provides only runtime AOP. There are solutions out there that can mix in your aspects at compile time (although I can't recall the name of any of them).



回答4:

DynamicProxy from CastleProject is probably the most lightweight and powerful solution regarding dynamic interception.



回答5:

I would suggest Spring.NET as well, but only because that's the only one I have experience with. Spring.NET offers so much more (IoC, transaction management, nice validation framework) but you can use just what you need from it.



回答6:

Spring.NET is great in general, and so is its AOP support.

No idea why people are saying to avoid it. Infact it is one of the most stable and reliable frameworks in the .NET world.

Dev progress is slow, but that is fine because it is already feature rich and stable.