Metalama 1.0 / / Metalama Documentation / Aspect API / Metalama.​Framework.​Project

Namespace Metalama.Framework.Project

This namespace fulfills the following purposes:

  • Gives read access to the project configuration, which includes the project references, preprocessor symbols, build properties, and other similar pieces of information. See the IProject interface for details. This interface is accessible from any code element through the ICompilation.Project property.

  • Allows you to implement a configuration API for your aspect library. See Exposing Configuration for details.

  • Exposes information about the current execution context on the MetalamaExecutionContext.Current property.

  • Exposes the service provider, which gives access from high-level code to the low-level plug-ins.

Conceptual documentation

See Exposing Configuration.

Class diagram

classDiagram class ICompilation { Project } class IProject { AssemblyReferences Configuration Path PreprocessorSymbols ServiceProvider TargetFramework TryGetProperty() Extension~T~() } class IExecutionContext { Compilation ExecutionScenario FormatProvider ServiceProvider } class MetalamaExecutionContext { Current } class IServiceProvider { GetService() } class IService { } class ProjectExtension { IsReadOnly Initialize() MakeReadOnly() } class IExecutionScenario { Name IsDesignTime CapturesCodeFixImplementations CapturesCodeFixTitles CapturesNonObservableTransformations } ICompilation --> IProject : exposes IProject --> IServiceProvider: exposes IProject --> ProjectExtension: exposes MetalamaExecutionContext --> IExecutionContext : exposes IExecutionContext --> IServiceProvider: exposes IExecutionContext --> IExecutionScenario: exposes IServiceProvider --> IService: provides

Namespace members



Exposes the current execution context of Metalama.


An base class that must be implemented by classes that want to extend IProject with project-local configuration data using the Extension<T>() method.


Provides extensions methods to the IServiceProvider interface.



Represents the execution context of Metalama. Exposed by the Current property of MetalamaExecutionContext.


Exposes the properties of the scenarios in which an aspect, template, or fabric is being executed. The interface is accessible from the MetalamaExecutionContext class.


Exposes the properties of the current C# project, such as Path, AssemblyReferences, PreprocessorSymbols, Configuration or TargetFramework. To access a custom MSBuild property, use TryGetProperty(String, out String). You can extend this interface with your own framework-specific by using the Extension<T>() method.