Open sandboxFocusImprove this doc

Pushing Information to Visual Studio Tools for Metalama and PostSharp Programmatically

The IWeavingSymbolsService service allows you to push information from your aspect, at build time, to Visual Studio Tools for Metalama and PostSharp.

This service can be used in the following scenarios:

  • Adding text to the CodeLens and IntelliSense tooltip of a declaration.

  • Adding code saving information.

  • Adding an annotation that tells Visual Studio Tools for Metalama and PostSharp to consider that a declaration has been decorated with a custom attribute. This annotation is then taken into account by the analytic engine that powers the real-time quick actions and diagnostics of Visual Studio Tools for Metalama and PostSharp. For instance, the FieldRule facility uses this feature.

To get an instance of this service, call the GetService<T>(bool) method of PostSharpEnvironment.CurrentProject.