Metalama.Framework 2025.0.4-preview

Prefix Reserved
This is a prerelease version of Metalama.Framework.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Metalama.Framework --version 2025.0.4-preview
                    
NuGet\Install-Package Metalama.Framework -Version 2025.0.4-preview
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Metalama.Framework" Version="2025.0.4-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Metalama.Framework" Version="2025.0.4-preview" />
                    
Directory.Packages.props
<PackageReference Include="Metalama.Framework" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Metalama.Framework --version 2025.0.4-preview
                    
#r "nuget: Metalama.Framework, 2025.0.4-preview"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Metalama.Framework@2025.0.4-preview
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Metalama.Framework&version=2025.0.4-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Metalama.Framework&version=2025.0.4-preview&prerelease
                    
Install as a Cake Tool

Metalama Logo

Metalama is a Roslyn-based framework for on-the-fly code generation and validation in C#.

Using Metalama, you can:

  • Reduce boilerplate by generating it dynamically during compilation. Your source code remains crystal-clear.
  • Verify code in real time against architecture, patterns, and conventions. No need to wait for code reviews.
  • Provide coding assistance to your team with customized feedback and suggestions.
  • Do it by your rules. Automate your own implementation patterns and architecture guidelines.

For more information, see the Metalama website or Metalama documentation.

About this package

The Metalama.Framework package is the principal package of Metalama. Reference this package if you want to use Metalama in your code.

Referencing this package replaces the compiler with Metalama.Compiler, a shallow fork of Roslyn that adds an extension point to allow us to transform the syntax trees. If you need to reference Metalama without replacing the compiler, use the Metalama.Framework.Redist package.

Package Name Description
Metalama.Compiler Metalama Compiler package. Referencing this package directly is not recommended. A fork of Roslyn.
Metalama.Compiler.Sdk Defines APIs for writing source transformers for Metalama.Compiler.
Metalama.Extensions.Architecture Verifies code against architecture rules in Metalama.
Metalama.Extensions.DependencyInjection Allows aspects to consume dependencies from an arbitrary dependency injection framework.
Metalama.Extensions.DependencyInjection.ServiceLocator Locates and pulls dependencies from a global service provider.
Metalama.Extensions.Metrics Exposes code metrics to the code model in Metalama.
Metalama.Extensions.Multicast Emulates PostSharp multicasting within Metalama.
Metalama.Framework The principal package.
Metalama.Framework.Introspection Provides introspection of Metalama aspect classes, instances, and diagnostics.
Metalama.Framework.Redist Redistributable components for Metalama.Framework. Should be installed as a dependency.
Metalama.Framework.RunTime Run-time components for Metalama.Framework. Usually installed as a dependency.
Metalama.Framework.Sdk A tool for custom source code modifying extensions using the Roslyn API.
Metalama.Framework.Workspaces Allows loading solutions and projects, executing Metalama, and introspection of compilation results.
Metalama.Migration Annotated PostSharp API documenting its Metalama equivalent.
Metalama.Patterns.Caching A caching front-end that can be plugged into different backends and helps with building the cache key, coping with special return types, and invalidating the cache.
Metalama.Patterns.Caching.Aspects A set of aspects that simplify the caching: [Cache] to cache a method result as a function of its parameters, [InvalidateCache] to invalidate the cache, or [CacheKey] to mark a cache key.
Metalama.Patterns.Caching.Backend Backend components for Metalama.Patterns.Caching.
Metalama.Patterns.Caching.Backends.Azure Synchronizes the invalidation of distributed Metalama.Patterns.Caching caches over Azure Service Bus.
Metalama.Patterns.Caching.Backends.Redis Redis back-end for Metalama.Patterns.Caching. Implements both caching and cache invalidation over Redis Pub/Sub.
Metalama.Patterns.Contracts Contract-Based Programming (or Design-by-Contract) with custom attributes such as [NotNull] or [Url] thanks to Metalama: pre-conditions, post-conditions and invariants.
Metalama.Patterns.Immutability Represents the concept of Immutable Type so that it can be used by other packages like Metalama.Patterns.Observability.
Metalama.Patterns.Memoization Simple and high-performance caching of properties or parameterless methods with a single [Memo] custom attribute thanks to Metalama.
Metalama.Patterns.Observability Implements the Observable pattern and the INotifyPropertyChanged interface with a single [Observable] attribute thanks to Metalama. Supports both automatic and explicit properties and child objects.
Metalama.Patterns.Xaml Provides custom observability features for XAML applications.
Metalama.Testing.AspectTesting Test framework for Metalama aspects and fabrics.
Metalama.Testing.UnitTesting A package for unit testing compile-time code.
Metalama.Tool Command line tool for registering a license key or accessing configuration settings.
Metalama.Community.AutoCancellationToken A Metalama weaver that automatically adds CancellationToken to your method definitions and your method calls.
Metalama.Community.Costura A Metalama weaver that embeds dependent assemblies as managed resources. A fork of Costura.Fody.
Metalama.Community.Costura.Redist Redistributable components for package Metalama.Community.Costura. Should only be installed as a dependency.
Metalama.Community.Virtuosity A Metalama weaver that makes all methods in a type virtual.

Change log

We maintain a detailed change log on GitHub.

Feedback and support

If you have any feedback regarding Metalama, please open an issue, start a discussion on GitHub, or contact us directly at hello@postsharp.net.

You can also join our Slack community and ask your technical questions in real time.

Slack

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages (28)

Showing the top 5 NuGet packages that depend on Metalama.Framework:

Package Downloads
Metalama.Extensions.DependencyInjection

An official and open-source Metalama extension that allows aspects to consume dependencies from an arbitrary dependency injection framework.

Tofi.Framework.Aspects

Package Description

Metalama.Patterns.Contracts

Contract-Based Programming (or Design-by-Contract) with custom attributes such as [NotNull] or [Url] thanks to Metalama: pre-conditions, post-conditions and invariants.

Shinya.Core

Shinya.Framework

Metalama.Extensions.Multicast

An official and open-source Metalama extension that emulates PostSharp multicasting.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Metalama.Framework:

Repository Stars
metalama/Metalama
A meta-programming framework for code generation, aspect-oriented programming, and architecture verification of large C# codebases.
Version Downloads Last Updated
2026.0.9-rc 84 12/12/2025
2026.0.8-rc 720 12/9/2025
2026.0.7-rc 1,005 12/4/2025
2026.0.6-rc 1,094 11/28/2025
2026.0.5-preview 1,896 11/12/2025
2026.0.4-preview 873 11/8/2025
2026.0.3-preview 1,058 10/30/2025
2026.0.2-preview 934 10/7/2025
2026.0.1-preview 887 10/4/2025
2025.2.5-rc 937 10/7/2025
2025.2.4-rc 918 10/1/2025
2025.2.2-preview 1,395 9/19/2025
2025.2.1-preview 854 9/9/2025
2025.1.17 1,175 12/9/2025
2025.1.16 6,193 10/22/2025
2025.1.15 5,042 10/7/2025
2025.1.14 1,641 9/30/2025
2025.1.13 9,439 9/5/2025
2025.1.12 6,475 8/7/2025
2025.1.11 6,916 7/23/2025
2025.1.10 11,250 7/3/2025
2025.1.9 18,733 5/29/2025
2025.1.8 2,043 5/26/2025
2025.1.7 1,557 5/22/2025
2025.1.6 1,738 5/15/2025
2025.1.5 8,960 5/2/2025
2025.1.4-rc 1,469 4/15/2025
2025.1.3-rc 1,305 4/9/2025
2025.1.2-preview 1,138 4/1/2025
2025.1.1-preview 1,134 3/18/2025
2025.0.12 3,396 5/22/2025
2025.0.11 807 5/2/2025
2025.0.10 10,380 3/31/2025
2025.0.9 14,160 3/7/2025
2025.0.8 44,933 1/6/2025
2025.0.7-rc 2,095 12/6/2024
2025.0.6-rc 3,048 11/15/2024
2025.0.5-preview 2,431 11/8/2024
2025.0.4-preview 696 10/31/2024
2025.0.3-preview 1,062 10/25/2024
2025.0.2-preview 875 10/24/2024
2025.0.1-preview 845 10/14/2024
2024.2.32 1,857 3/7/2025
2024.2.31 6,106 12/6/2024
2024.2.30 10,532 11/15/2024
2024.2.29 3,764 10/31/2024
2024.2.28 1,476 10/25/2024
2024.2.27 1,155 10/24/2024
2024.2.26 20,822 10/14/2024
2024.2.25 3,919 10/2/2024
2024.2.24 39,075 9/10/2024
2024.2.23 18,502 8/30/2024
2024.2.22 1,293 8/29/2024
2024.2.21 9,044 8/28/2024
2024.2.20 25,326 8/15/2024
2024.2.19 6,641 8/1/2024
2024.2.18 1,747 7/29/2024
2024.2.17-rc 921 7/22/2024
2024.2.16-rc 4,298 7/18/2024
2024.2.15-rc 1,118 7/12/2024
2024.2.14-rc 4,414 7/8/2024
2024.2.13-rc 1,047 7/2/2024
2024.2.12-preview 1,248 6/28/2024
2024.2.11-preview 1,057 6/26/2024
2024.2.10-preview 1,067 6/20/2024
2024.2.9-preview 1,200 6/11/2024
2024.2.8-preview 977 6/6/2024
2024.2.7-preview 1,089 5/30/2024
2024.2.6-preview 1,086 5/25/2024
2024.2.5-preview 1,125 5/6/2024
2024.2.4-preview 1,004 5/4/2024
2024.2.3-preview 1,071 4/30/2024
2024.2.2-preview 990 4/23/2024
2024.2.1-preview 1,088 4/11/2024
2024.1.30 1,099 10/24/2024
2024.1.29 997 10/11/2024
2024.1.28 1,229 9/9/2024
2024.1.27 1,163 8/28/2024
2024.1.26 1,414 8/15/2024
2024.1.25 2,598 7/22/2024
2024.1.24 8,747 7/12/2024
2024.1.23 7,333 6/26/2024
2024.1.22 2,715 6/15/2024
2024.1.21 13,681 6/6/2024
2024.1.20 4,978 5/30/2024
2024.1.19 1,821 5/24/2024
2024.1.18 43,001 5/6/2024
2024.1.17 2,969 5/3/2024
2024.1.16 19,209 4/30/2024
2024.1.15 2,606 4/29/2024
2024.1.14 3,177 4/23/2024
2024.1.13 1,263 4/23/2024
2024.1.12 1,820 4/17/2024
2024.1.11-rc 986 4/11/2024
2024.1.10-rc 1,063 4/4/2024
2024.1.9-rc 1,128 3/27/2024
2024.1.8-preview 1,047 3/25/2024
2024.1.7-preview 1,189 3/19/2024
2024.1.6-preview 1,266 3/6/2024
2024.1.5-preview 1,262 2/29/2024
2024.1.4-preview 1,464 2/27/2024
2024.1.3-preview 1,308 2/23/2024
2024.1.2-preview 1,689 2/7/2024
2024.1.1-preview 1,568 1/30/2024
2024.0.16 1,131 6/15/2024
2024.0.15 1,060 6/6/2024
2024.0.14 1,064 5/30/2024
2024.0.13 1,022 5/24/2024
2024.0.12 1,227 4/17/2024
2024.0.11 38,906 3/21/2024
2024.0.10 1,962 3/19/2024
2024.0.9 6,731 2/29/2024
2024.0.8 3,166 2/23/2024
2024.0.7 14,783 2/7/2024
2024.0.6 17,654 1/3/2024
2024.0.5-rc 1,532 12/21/2023
2024.0.4-rc 1,837 12/12/2023
2024.0.3-preview 1,827 12/6/2023
2024.0.2-preview 4,995 11/14/2023
2024.0.1-preview 1,941 11/6/2023
2023.4.9 5,493 2/7/2024
2023.4.8 9,901 12/21/2023
2023.4.7 2,412 12/12/2023
2023.4.6 21,211 11/7/2023
2023.4.5-rc 2,038 10/26/2023
2023.4.4-preview 1,874 10/18/2023
2023.4.3-preview 3,123 10/4/2023
2023.4.2-preview 1,827 9/26/2023
2023.4.1-preview 1,795 9/13/2023
2023.3.10 1,538 12/21/2023
2023.3.9 1,691 12/12/2023
2023.3.8 12,641 10/17/2023
2023.3.7-rc 1,783 9/29/2023
2023.3.6-rc 1,847 9/26/2023
2023.3.5-rc 1,860 9/13/2023
2023.3.4-preview 2,114 8/30/2023
2023.3.3-preview 1,871 8/29/2023
2023.3.2-preview 4,141 8/1/2023
2023.3.1-preview 2,211 7/28/2023
2023.2.5 22,636 9/12/2023
2023.2.4 11,729 8/7/2023
2023.2.3-rc 2,188 8/3/2023
2023.2.2-rc 2,428 7/21/2023
2023.2.1-preview 3,346 6/27/2023
2023.1.12 2,086 9/12/2023
2023.1.11 2,890 8/7/2023
2023.1.10 3,797 7/17/2023
2023.1.9 2,706 6/27/2023
2023.1.8-rc 1,862 6/19/2023
2023.1.7-rc 1,656 6/14/2023
2023.1.6-rc 2,253 6/12/2023
2023.1.5-preview 2,474 5/26/2023
2023.1.4-preview 1,530 5/26/2023
2023.1.3-preview 2,209 5/25/2023
2023.1.2-preview 2,184 5/24/2023
2023.1.1-preview 4,976 5/10/2023
2023.0.121 1,661 7/17/2023
2023.0.120 1,709 6/27/2023
2023.0.119 14,771 6/14/2023
2023.0.118 1,995 6/7/2023
2023.0.117 2,844 5/25/2023
2023.0.116 2,067 5/23/2023
2023.0.115 6,073 5/4/2023
2023.0.113-rc 2,914 4/21/2023
2023.0.112-rc 1,755 4/14/2023
2023.0.111-rc 3,100 4/5/2023
2023.0.110-rc 2,239 3/30/2023
2023.0.109-rc 2,658 3/23/2023
2023.0.108-rc 2,220 3/15/2023
2023.0.107-rc 3,365 3/1/2023
2023.0.106-rc 380 2/27/2023
2023.0.105-rc 3,363 2/22/2023
2023.0.104-rc 2,328 2/21/2023
2023.0.102-rc 5,831 2/9/2023
2023.0.101-rc 4,691 1/25/2023
0.5.83-preview 2,580 1/23/2023
0.5.82-preview 2,429 1/23/2023
0.5.81-preview 2,363 1/18/2023
0.5.80-preview 2,343 1/15/2023
0.5.79-preview 2,297 1/13/2023
0.5.78-preview 2,474 1/10/2023
0.5.77-preview 2,261 1/9/2023
0.5.76-preview 2,409 1/6/2023
0.5.75-preview 2,315 1/5/2023
0.5.74-preview 2,342 1/3/2023
0.5.73-preview 3,059 12/15/2022
0.5.72-preview 2,282 12/13/2022
0.5.71-preview 2,939 12/10/2022
0.5.70-preview 2,340 12/9/2022
0.5.69-preview 2,243 12/8/2022
0.5.68-preview 1,652 12/5/2022
0.5.67-preview 1,776 12/2/2022
0.5.66-preview 1,657 11/30/2022
0.5.65-preview 1,584 11/30/2022
0.5.64-preview 1,575 11/29/2022
0.5.63-preview 2,280 11/25/2022
0.5.62-preview 1,592 11/24/2022
0.5.61-preview 1,507 11/17/2022
0.5.60-preview 1,534 11/17/2022
0.5.59-preview 1,467 11/16/2022
0.5.58-preview 1,603 11/15/2022
0.5.57-preview 1,633 11/10/2022
0.5.56-preview 1,783 11/8/2022
0.5.55-preview 1,538 11/3/2022
0.5.54-preview 1,525 11/2/2022
0.5.53-preview 1,515 11/1/2022
0.5.52-preview 1,591 10/28/2022
0.5.51-preview 2,179 10/27/2022
0.5.50-preview 956 10/24/2022
0.5.49-preview 500 10/20/2022
0.5.48-preview 831 10/18/2022
0.5.47-preview 753 10/12/2022
0.5.46-preview 621 10/6/2022
0.5.45-preview 407 10/6/2022
0.5.44-preview 703 10/4/2022
0.5.43-preview 775 10/1/2022
0.5.42-preview 518 9/29/2022
0.5.41-preview 1,139 9/28/2022
0.5.40-preview 1,309 9/9/2022
0.5.39-preview 583 9/6/2022
0.5.38-preview 533 9/3/2022
0.5.37-preview 1,617 8/19/2022
0.5.36-preview 784 8/9/2022
0.5.35-preview 474 8/6/2022
0.5.34-preview 648 8/4/2022
0.5.33-preview 323 8/2/2022
0.5.32-preview 502 7/28/2022
0.5.31-preview 443 7/26/2022
0.5.30-preview 752 7/22/2022
0.5.29-preview 692 7/21/2022
0.5.28-preview 742 7/20/2022
0.5.27-preview 445 7/19/2022
0.5.26-preview 644 7/12/2022
0.5.25-preview 1,017 6/25/2022
0.5.24-preview 630 6/23/2022
0.5.23-preview 1,114 6/7/2022
0.5.22-preview 637 5/31/2022
0.5.21-preview 499 5/27/2022
0.5.20-preview 466 5/24/2022
0.5.19-preview 866 5/17/2022
0.5.18-preview 445 5/12/2022
0.5.16-preview 500 5/9/2022
0.5.15-preview 452 5/7/2022
0.5.13-preview 871 4/28/2022
0.5.12-preview 508 4/27/2022
0.5.11-preview 492 4/15/2022
0.5.10-preview 478 4/15/2022
0.5.9-preview 431 4/14/2022
0.5.8-preview 558 4/7/2022
0.5.7-preview 474 3/22/2022
0.5.6-preview 508 3/16/2022
0.5.5-preview 467 3/15/2022
0.5.4-preview 450 3/14/2022
0.5.3-preview 456 3/9/2022
0.5.2-preview 458 2/23/2022
0.5.1-preview 494 2/18/2022
0.5.0-preview 410 2/7/2022