Logging and Caching aspects issues

jonyadamit's Avatar


03 Sep, 2017 10:15 AM

After upgrading from version 5.0.31 to 5.0.32, I get an error stating:

Incorrect ordering of advices on method "[MethodName]Async(System.Guid, System.String, System.Object)". Advice "PostSharp.Patterns.Caching.CacheAttribute: Intercepted by OnInvokeAsync" cannot be after advice "PostSharp.Patterns.Diagnostics.LogExceptionAttribute: Transformed by state-machine-aware advice." because state-machine-aware advices must be positioned after all other advices.

Logging is applied on assembly level.
Adding [Log(AttributeExclude = true)] to the affected methods does not alleviate the problem.
Since logging is applied as I said on assembly level, and caching is required on those specific methods, this leaves me with no choice but to downgrade to PostSharp 5.0.31.

Please assist.

  1. Support Staff 1 Posted by PostSharp Techn... on 04 Sep, 2017 04:04 PM

    PostSharp Technologies's Avatar


    This error is caused by a current limitation of aspects compatibility. We're working on solving this limitation in the next release (5.1).
    The correct workaround is to apply [Log(AttributeExclude = true)] to the affected method, so we need to investigate why this doesn't work in your case.

    Our tests so far show that excluding attribute solves the problem. Could you please send us a sample reproduction project, where the error appears even when the attribute is excluded?


  2. 2 Posted by jonyadamit on 04 Sep, 2017 05:30 PM

    jonyadamit's Avatar

    I guess I'll just wait for version 5.1.
    It took me hours downgrading because it caused plenty version redirect conflicts, I cannot spare more time testing this.
    It could be that those errors did not clear because of other issues I had at the time as a result of the upgrade, so I suppose you can close this issue for now.

    Best regards, Jonathan.

  3. PostSharp Technologies closed this discussion on 05 Sep, 2017 08:35 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac