Skip to main content

Metalama Technical Guide

Scope: All developers working with the GST framework (GST.Core.Aspects)

Audience: New developers, partners, and anyone learning Metalama-based AOP

Prerequisites: Basic C# and .NET knowledge

Estimated Reading Time: 2–3 hours (full guide)

Version: 1.0

Last Updated: 2026-03-31

Metalama Version: 2025.1.17 (GST) / 2026.1 (latest)


What This Guide Covers

This guide is a comprehensive introduction to Metalama, a compile-time Aspect-Oriented Programming (AOP) framework for C#. It is designed for developers who are new to AOP or Metalama and want to understand the technology deeply — from foundational concepts to real-world usage in the GST framework.

Guide Structure

ChapterTopicDescription
1Overview (this page)What this guide is and how to use it
2AOP FundamentalsWhat AOP is, why it matters, and key terminology
3Getting StartedInstallation, setup, and your first aspect
4Core ConceptsHow aspects work, lifecycle, ordering, and composition
5T# Template LanguageThe compile-time template system that powers Metalama
6Aspect Base ClassesAll base classes explained with examples
7FabricsBulk aspect application without attributes
8Pattern LibrariesBuilt-in patterns: Contracts, Caching, Observability
9GST Real-World ExamplesHow the GST framework uses Metalama in production
10Advanced TopicsAdvising, member introduction, eligibility, diagnostics
11Testing & DebuggingHow to test and debug aspects and transformed code
12Advantages & DisadvantagesHonest assessment of when to use (and not use) Metalama
13Best PracticesDesign principles, common pitfalls, and guidelines

How to Read This Guide

For Absolute Beginners

Start with Chapter 2 (AOP Fundamentals) to understand the problem that AOP solves. Then proceed through Chapter 3 (Getting Started) and Chapter 4 (Core Concepts) before exploring the rest.

For Experienced C# Developers New to AOP

Skim Chapter 2 for terminology, then dive into Chapter 3 and Chapter 5 (T# Templates) — the template language is the most unique aspect of Metalama and the key to mastering it.

For Developers Already Familiar with PostSharp or Other AOP Frameworks

Jump to Chapter 5 (T# Templates), Chapter 6 (Base Classes), and Chapter 12 (Pros & Cons) for a comparison with other frameworks.

For GST Framework Users

Chapter 9 (GST Real-World Examples) is essential reading. It explains the architecture, conventions, and all 32 aspects available in GST.Core.Aspects. Pair it with the GST Aspect Usage Guide for project-level rules.


DocumentDescription
GST Aspect Usage GuideRules and conventions for using GST aspects in application projects
GST Framework GuideOverall GST framework architecture and concepts
Metalama Official DocsOfficial Metalama documentation
Metalama GitHubSource repository

Version History

VersionDateChanges
1.02026-03-31Initial release — complete guide covering Metalama 2025.1/2026.1