Metalama (preview)Commented examplesShared Fabrics
Open sandboxFocusImprove this doc

Example: shared fabrics

This example has been kindly contributed by Whit Waldo.

It demonstrates the techniques explained in Adding aspects to multiple projects. It is best viewed in GitHub, or when locally, rather than in the documentation browser.

It contains the following files and directories:

  • SharedAspects/ is a project containing shared Metalama aspects, in this case, logging.
  • Models/ and App/ are two projects that must be logged.
  • SharedFabrics.cs is a project fabric that adds the logging aspect to all public and internal classes of the current project.
  • Directory.Build.props includes SharedFabrics.cs in all projects in any subdirectory.