c# - PostSharp Conflicting Aspects warning -
i'm using postsharp express in vs2013 create validation aspects can apply properties. followed this postsharp guide on location interception. work getting hundreds of warnings stating:
conflicting aspects on "mynamespace.get_myproperty": transformations ".myvalidation1attribute: intercepted advice ongetvalue, onsetvalue" , "mynamespace.validation2attribute: intercepted advice ongetvalue, onsetvalue" not commutative, not ordered. order of execution undeterministic.
which think result of placing multiple validation aspects on same properties. first tried comma-separate attributes, understand supposed order them: [validation1,validation2]
warnings still remained.
since aspects commutative (it doesn't matter order executed), the postsharp docs advise mark them such using aspecttypedependency follows:
[aspecttypedependency(aspectdependencyaction.commute, typeof(ilocationvalidationaspect))]
however, appears postsharp.aspects.dependencies
namespace not included under express license. there possible solution resolving these warnings using express license? or mean can't ever use more 1 aspect without buying pro or ultimate? willing try implement own dependency controller if remove these warnings way.
aspecttypedependency requires professional edition. aspecttypedependency type should included in express edition - there should using non-licensed feature build time error then.
you can use aspectpriority:
[validation1(aspectpriority = 1), validation2(aspectpriority = 2)]
alternatively can assign priority in aspect constructor. less flexible aspect ordering @ least resolves warning.
Comments
Post a Comment