PostSharp 2026.0 introduces support for .NET 10.0 and C# 14.0. It also removes support for obsolete target frameworks and features.
Note
Please note that this release includes several breaking changes. Refer to Breaking Changes in PostSharp 2026.0 for more detailed information.
Support for .NET 10 and C# 14
We've added support for .NET 10 SDK to all packages.
In C# 14, the only change impacting PostSharp was extension blocks.
Extension blocks
C# 14 introduces extension blocks, a new syntax for defining extension methods and properties using an extension<T> declaration instead of the classic this modifier. The C# compiler implements these as static methods and compiler-generated metadata types, which presents challenges for PostSharp:
- Multicasting: Previous versions of PostSharp would multicast aspects to all compiler-generated implementation methods, including those from extension blocks. In PostSharp 2026.0, multicast attributes skip extension block members by default to prevent unexpected behavior.
- IAspectProvider/IAdviceProvider: These interfaces receive IL-level reflection objects (static methods and metadata types) rather than the C# source syntax. Since PostSharp relies on
System.Reflectionto provide access to the code model, developers using these interfaces must manually identify and filter extension block metadata.
To address these challenges, PostSharp 2026.0 introduces:
- MulticastAttribute.AllowExtensionBlockMembers and MulticastAttributeUsageAttribute.AllowExtensionBlockMembers - Set to
trueto enable multicasting to extension block members (default:false) - <xref:PostSharp.Reflection.ReflectionHelper.IsExtensionBlockMetadata> - Helper method to identify and filter compiler-generated extension block metadata when using
IAspectProviderorIAdviceProvider
For detailed information, examples, and best practices, see C# 14 extension blocks and multicasting.
Deprecation of unsupported target frameworks
We removed support for all pre-2017 target frameworks, as well as the versions of .NET Core that fell out of mainstream support. The new baseline frameworks are now .NET Standard 2.0, .NET Framework 4.7.0, and .NET 6.0.
Refer to Breaking Changes in PostSharp 2026.0 for more detailed information.