Features

Metalama is a powerful meta-programming framework for C# based on Roslyn. It specializes in code generation (including aspect-oriented programming) and code validation. Additionally, it allows you to create custom code fixes or refactorings.

FeatureDescription
Code GenerationMetalama is the most powerful and simplest code generation framework for C#. Inspired by aspect-oriented programming, it’s the only Roslyn-based approach that seamlessly integrates generated code with hand-written code, making it possible to implement most code patterns.
Code VerificationMetalama makes it easy to validate hand-written or AI-generated code in real time, reporting errors and warnings when rules are violated. Thanks to the architecture validation package, you can also verify dependencies between classes and namespaces.
Design-Time FeedbackMetalama provides real-time feedback as you type, eliminating the need to constantly rebuild to refresh your IDE. Unlike MSIL-based approaches, and thanks to its integration with Roslyn source generators, Metalama allows you to reference generated declarations from hand-written code.
Code Fix Toolkit Boost your team’s productivity by suggesting custom code fixes for any errors or warnings reported by your code verification logic.
Ready-to-Use Aspect LibrariesNo need to reinvent the wheel. Metalama comes with many professionally built and tested aspects that you can pull from NuGet and start using immediately.
Visual Studio Tooling See how your code is affected by aspects directly in Visual Studio with Code Lens integration, Aspect Diff, and Aspect Explorer. Get syntax highlighting for T#, Metalama’s C#-to-C# template language.
Test FrameworksTest code generation patterns and the reporting of warnings and errors.
Transformed Code DebuggingChoose whether to step into the transformed code or stick to the source code during debugging. You can see exactly which code is executed.
Code Query APIQuery your code as a database and explore code references using LINQPad. Access the Metalama object model to diagnose how aspects and fabrics affect your code.
DivorceMetalama makes it easy to part ways when needed. Run the metalama divorce command to commit the generated code into your source code and return to the plain Jane Microsoft’s compiler.