Open sandboxFocusImprove this doc

Migrating from PostSharp

You may want to migrate some or all of your projects from PostSharp to Metalama. If you decide to proceed, this chapter will help you.

When we conceptualized Metalama as the successor to PostSharp, we chose to break backward compatibility. The PostSharp Framework was designed during the years of C# 2.0 and .NET Framework 2.0 (2004-2010), and we've maintained backward compatibility since then. We couldn't leverage the new .NET stack (C# 11, .NET 6, and Roslyn) while adhering strictly to our 2010 API. We opted for a comprehensive redesign of the concepts and APIs.

However, many customers have codebases ranging from tens of thousands to millions of lines of code that use PostSharp. We ensured these customers wouldn't need to port these large codebases.

We made the following decisions:

  • You'll need to completely rewrite your aspects.
  • The business code that uses the aspects typically doesn't require any changes, except for find-and-replace-in-files operations and namespace import replacements.

In this chapter

Article Description
Migrating custom aspects to Metalama Provides step-by-step guidance for your migration project and refers to other articles in this chapter.
Benefits of Metalama over PostSharp Describes the advantages of Metalama over PostSharp.
When to migrate from PostSharp to Metalama Provides points to consider before migrating your aspects to Metalama. Read this article before making any decisions.
Status of the migration of PostSharp features to Metalama Describes the status of PostSharp features in Metalama.
Differences between Metalama and PostSharp Discusses the significant architectural differences between PostSharp and Metalama from a theoretical perspective.
Migrating PostSharp attribute multicasting to Metalama Explains how to migrate PostSharp attribute multicasting to Metalama.
Migrating PostSharp configuration to Metalama Explains how to migrate PostSharp configuration files like postsharp.config to Metalama.