I'm using PostSharp 2.1.5.1 and had a warning today:
Aspect dependencies (defined on "MyNamespace.MyAspect.MyVerificationAttribute") will be disabled from the Starter Edition in future versions. Use the AspectPriority property instead.
Seems to me that following line is causing that warning:
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.After, StandardRoles.Tracing)]
Could someone point me to a correct example of how to use AspectPriority
? Are the following examples up to date?
http://www.sharpcrafters.com/blog/post/introducing-postsharp-2-0-3-aspect-dependencies.aspx (section "Old Good Aspect Priority")
http://www.sharpcrafters.com/blog/post/Day-3-Applying-Aspects-with-Multicasting-Part-2.aspx (section "Aspect Priority")
Thanks.
The correct usage is AttributePriority. Lower values are higher priority, or aspects that get applied first.
[Trace(AttributePriority = 2)]
[HandleError(AttributePriority = 1)]
public void MyMethod()
{
}
Aspect Priority hasn't been valid for a while. AspectDependencyAction determines the "priority" between two aspects. Meaning, if Aspect1 depends on Aspect2 then and the AspectDependencyAction.Order = After then Aspect1 gets applied after Aspect2 has been applied. but that isn't what you are looking for (I think). Just use AttributePriority instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With