Open sandboxFocusImprove this doc

PS0110: Too Many Advices on the Same Join Point

Severity Error
Reported by PostSharp
Message There cannot be more than 32 advices on the same join point in method "<Method>".

Cause

The low-level code weaver of PostSharp, which the aspect framework and the add-ins of the PostSharp SDK use to modify the body of methods, combines the advices of a join point (the entry of a method, its exit, a call to another method, an access to a field) with a bit mask of 32 bits. When more than 32 advices of this weaver apply to the same join point of a method, PostSharp reports PS0110 and does not weave this join point.

The aspects of the PostSharp aspect framework do not reach this limit in practice, because the framework weaves the aspects of a method through a few advices of the low-level weaver, not one advice per aspect. For example, 33 instances of an OnMethodBoundaryAspect on the same method build without this error. Only an add-in that adds its own advices to the low-level weaver, or several such add-ins together, can report it.

This message depends on add-ins built on the low-level PostSharp SDK, so no example can show it.

Resolution

  • If you develop the add-in, combine the advices that it adds to the same join point into a single advice that handles all of them.
  • If the add-in comes from a third party, find which add-in adds the advices by removing the add-ins one at a time from the project, and report the problem to its vendor with the name of the method.
  • Otherwise, contact PostSharp support with the name of the method and the list of aspects and add-ins of the project.

See Also

Other Resources

Coping with Several Aspects on the Same Target