MetalamaConceptual documentationMigrating from Post­Sharp
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 assist you.

When we conceptualized Metalama as the successor to PostSharp, we elected to break backward compatibility. After all, the PostSharp Framework was designed during the years of C# 2.0 and .NET Framework 2.0 (2004-2010), and we have maintained backward compatibility since then. We could not leverage the new .NET stack (for instance, C# 11, .NET 6, and Roslyn) by adhering strictly to our 2010 API. Thus, we opted for a comprehensive redesign of the concepts and APIs.

However, we understand that many customers have codebases ranging from tens of thousands to millions of lines of code that utilize PostSharp. That's why we ensured that these customers wouldn't need to port these large codebases.

Consequently, we made the following decisions:

  • You will need to completely rewrite your aspects.
  • The business code that merely uses the aspects should not typically require any changes, except for find-and-replace-in-files operations and replacements of namespace imports.

We hope this is a satisfactory compromise.

In this chapter

Article Description
Migrating custom aspects to Metalama This article provides a comprehensive step-by-step guide for your migration project and refers to other articles in this chapter.
Benefits of Metalama over PostSharp This article outlines the advantages of Metalama over PostSharp.
When to migrate from PostSharp to Metalama This article offers a few points to consider before migrating your aspects to Metalama. Ensure you read this article before making any decisions.
Status of the migration of PostSharp features to Metalama This article details the status of PostSharp features in Metalama.
Differences between Metalama and PostSharp This article discusses the significant architectural differences between PostSharp and Metalama from a theoretical perspective.
Migrating PostSharp attribute multicasting to Metalama This article guides you on how to migrate PostSharp attribute multicasting to Metalama.
Migrating PostSharp configuration to Metalama This article instructs you on how to migrate PostSharp configuration files like postsharp.config to Metalama.