Skip to main content
.NETStandard2.0

An open-source patterns & architecture toolkit for C#. Define your team's patterns once: the compiler writes the repetitive parts at build time and enforces your rules as you type.

Published
Oct 13, 2026
5d ago
Total Downloads
1.5M
1,543,694

Install

dotnet add package Metalama.Framework --version 2027.0.4-preview
ProductVersions
.NET Standard
netstandard2.0

README

Metalama by PostSharp

An open-source patterns & architecture toolkit for C#.

Metalama lets you define your team's patterns once: the compiler writes the repetitive parts at build time and enforces your rules as you type.

Why Metalama?

  • Write the pattern once, apply it everywhere: Aspects generate the repetitive code at compile time; the boilerplate never lands in the repo, so it never needs review or maintenance.
  • Enforce architecture as you type: Dependency rules, naming conventions, and pattern guidelines in plain C#, with real-time IDE feedback long before the pull request.
  • Stay consistent in the AI era: Hand-written or AI-generated, every line is checked against your rules; a pattern change is one file edit and the whole codebase follows at the next build.

Built on Roslyn by the PostSharp team, who have been doing compiler-level meta-programming in .NET since 2004.

When to use it?

Metalama is ideal for:

  • Large projects: Automate repetitive patterns across dozens of entities and hundreds of properties or methods.
  • Large teams: Align developers on consistent patterns and practices.
  • Long lifecycle projects: Maintain quality over years of development.

Its main use cases are:

License

Metalama is vendor-led open source: built and maintained by full-time engineers, funded by commercial licenses.

The core framework, which is the large majority of the codebase, is released under the MIT license. It cannot be taken away, relicensed, or paywalled.

Some optional extensions and IDE tooling are released under a proprietary license. πŸ’Ž

Features

Resources

Quick Start

  1. Add the Metalama.Framework package to your project:

    dotnet add package Metalama.Framework
    
  2. Optionally, install Metalama Tools for Visual Studio Extension. It's free for individuals, non-commercial uses, and companies with up to 3 users.

  3. Explore the Metalama Marketplace for ready-made aspects or examples.

  4. Follow the Getting Started guide to create your first aspect.

Building Metalama from Source

Please check instructions here.

Contributing

Contributions are accepted through the following channels:

For more details, see Contributing to Metalama.

Support

Related Packages

Changes from Previous Version

No structural changes between v2027.0.3-preview and v2027.0.4-preview.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.