PostSharp Aspects are really powerful in applying some useful Aspects like Handling Exception. If you don’t know about PostShap Exception handling Check this Post.
One of PostSharp powerful Utilities is Multicast which is simply applying an Aspect to a whole Namespace with a single line of code .. Magic isn’t it 🙂
You can Multicast an Aspect by simply adding the following line to the Solution AssemblyInfo.cs File under Properties.
[assembly: ExceptionAspect(AttributeTargetTypes = "AOP_Project.Code.*")]
ExceptionAspect is the name of the Aspect i want to insert and “AOP_Project.Code.*” is the target namespace where all the classes under it will have that Aspect while building the solution.
That’s it now you can apply Exception Aspect to all your solution with a single line 🙂