Releases: postsharp/PostSharp.Public
Release list
PostSharp 2027.0.2-preview
PostSharp 2027.0.2-preview is based on v2027.0.1-preview, plus the following changes.
New
- #168 Advice parameter binding is now a publicly supported feature, after years of internal use by the Pattern Libraries. An advice method can receive only the values it needs, as typed parameters bound by attributes such as
[Argument],[This]and[State], instead of anAdviceArgsobject allocated on every call. This release reports invalid bindings as errors (#161, #162) and makes simple declarative aspects less verbose (#192). - #187 Added support for runtime-generated async methods (
<Features>runtime-async=on</Features>on .NET 11), whose state machine is generated by the runtime instead of the C# compiler. Aspects applied to these methods previously failed at run time withInvalidProgramException. Aspects see the same advices, in the same order and with the same arguments, as with a compiler-generated state machine. - #188 A repository can opt out of telemetry for every build and every machine by setting the
TelemetryEnabledproperty toFalsein thepostsharp.configfile at its root. - SharpCrafters.Backstage#24 Added the reading of a configuration file at the root of the repository. PostSharp reads
postsharp.config, where a repository can opt out of telemetry with theTelemetryEnabledproperty (postsharp/PostSharp.Public#188). A file that cannot be read is reported as a build warning.
Enhancements
- #192 In a declarative aspect,
[SelfPointcut]andMastercan now be omitted when there is only one way to group the advices.
Fixes
- #161 Fixed an internal compiler exception, or an advice silently disabled, when an advice method has an invalid parameter binding, for example two binding attributes on one parameter or a parameter type that is not compatible with the bound value. An error located at the parameter is now reported.
- #162 Fixed invalid IL, or an internal compiler exception, when an advice with bound parameters does not match its target, for example
[Argument(n)]with an index out of range or[This]on a static target. An error that names the advice, the parameter and the target is now reported. - #171 The
PostSharp.Toolpackage, which was missing from 2027.0.1-preview, is now published, sodotnet tool install -g PostSharp.Toolinstalls thepostsharpcommand line tool. - #182 Warnings about the repository configuration, for example a
postsharp.configfile that cannot be read, are now reported as PS0284 build warnings located at the file. They were previously ignored. - SharpCrafters.Backstage#26 Fixed usage telemetry slowing down the parallel build of a large solution. Each project now records its usage session separately, so build processes no longer wait for each other on a single lock (metalama/Metalama#2092).
- SharpCrafters.Backstage#25 Fixed a crash with
COMExceptionwhen Windows refuses to display a toast notification. The notification is now skipped when the machine cannot display it (metalama/Metalama#2047).
Resources
PostSharp 2027.0.1-preview
PostSharp 2027.0.1-preview is the first preview of PostSharp 2027.0. It is based on v2026.0.18, plus the following changes.
PostSharp 2027.0 moves the supported platforms to .NET 10 and .NET 11, and replaces the licensing, configuration, telemetry and user interface services of the compiler with the infrastructure stack that Metalama also uses. The PostSharp Options application is replaced by a web-based user interface and by the new postsharp command line tool. Several of these changes are breaking: read the section below before upgrading.
Warning
The PostSharp.Tool package, which provides the postsharp command line tool, was not uploaded to nuget.org with this release by mistake, so dotnet tool install -g PostSharp.Tool fails for now. It will be published with the next release (#171). Until then, supply a licence key through the PostSharpLicense MSBuild property or postsharp.config.
Breaking Changes
- #87
net6.0,net8.0andnet9.0are no longer supported target frameworks, and the packages no longer ship assets for them.net10.0andnet11.0are supported, and the minimum SDK at build time is the .NET 10 SDK. - #114 Removed the PostSharp Options application (
PostSharp.Settings.UI.exeandPostSharp.Settings.exe). It is replaced by a web-based user interface, which is shared with Metalama: the build shows toast notifications, and they open pages served locally in the browser, for example to register a licence key. SetPostSharpDisableUserInterfacetoTrueto silence them. - #117 Interactive builds on Linux and macOS now require a licence, as they always have on Windows. Builds under a CI agent, a service or a container remain unattended.
- #118 Usage telemetry is switched on at the first build unless the user opts out, with a notification that says how to turn it off. Crash reporting is unchanged and is never sent without consent.
- #142 Add-ins compile against the reference assemblies of the new
PostSharp.Sdkpackage.PostSharp.Compiler.CommonandPostSharp.Compiler.Enginenow only depend on it. - #145 Builds on Windows build agents now use the pipe server, which keeps running after the build. Set
PostSharpUsePipeServer=Falseto restore the former behaviour.PostSharpAllowPipeServerWhenUnattendedis obsolete.
New
- #119 Added the
postsharpcommand line tool (dotnet tool install -g PostSharp.Tool), which registers licence keys, edits settings and reports the telemetry state, on Windows, Linux and macOS. - #124 Added
postsharp shutdown, which stops the PostSharp processes that keep running after a build, such as the pipe server. - SharpCrafters.Backstage#15
postsharp shutdownalso stops the .NET build servers (dotnet build-server shutdown, theVBCSCompilerserver and the MSBuild nodes) and the background worker and notifier. Without--force, a process that does not exit is reported as still running.postsharp killis another name of the same command. - #170 Added support for licence keys signed with Elliptic Curve DSA (P-256 and SHA-256). Keys signed with DSA, which include every key issued so far, remain valid. Finite field DSA is not available on macOS in .NET 11, so a signed licence key can now be verified on every supported platform.
Fixes
- #115 Fixed an intermittent build failure with
ObjectDisposedException: Safe handle has been closedwhile assembly identities are read concurrently, for example in a solution build through the pipe server. - #116 Fixed a build failure with PS0242 in a linked git worktree when the licence key is limited to a namespace.
- #154 Fixed, on Linux and macOS, a package whose version contains an upper-case letter (for example
1.0.0-RC1) being left out of the dependencies of the compiler, with a "Couldn't locate restored package" warning. - #159 Fixed a hang of the Redis caching backend in
Clear,InvalidateDependencyorCleanUpAsync, which kept a CPU core busy and ignored the cancellation token. - #160 Fixed a
NullReferenceExceptioninMultiplexerBackendwhen a child logging backend creates no transaction.
Resources
PostSharp 2026.0.18
PostSharp 2026.0.18 is based on v2026.0.17 and v2024.0.27.
This release forward-ports the upstream v2024.0.27 changes to the 2026.0 line: the build now retries transient file system errors during assembly resolution instead of failing with LA0014 or PS0264 or silently binding another build of an assembly, and binding failures are reported with a PS0265 binding record. It contains no other change.
Resources
- Milestone 2024.0.27 (upstream)
PostSharp 2024.0.27
PostSharp 2024.0.27 is based on v2024.0.26, plus the following changes.
This release makes the .NET Framework build host behave correctly when a file is temporarily inaccessible, for example because another process holds a lock on it or security software denies access to it (#152). A transient file error is now retried for a bounded time, an error that persists fails the build with its actual cause, and a transient error no longer changes which assembly the build uses.
Enhancements
- #144 When an aspect constructor or an assembly load fails because an assembly cannot be bound,
LA0014andPS0264are now followed by aPS0265message with the binding record: the lookups of the host assembly store, the last exception caught during the lookup, and the runtime binding log. A failure can therefore be diagnosed without a second build withPostSharpTrace=AssemblyBinder. The trace also distinguishes a missing file from a file that cannot be accessed. AFileNotFoundExceptionorFileLoadExceptionthat is not about an assembly is now reported asPS0099with its message, instead ofPS0264.
Fixes
- #148 Fixed intermittent
LA0014andPS0264errors with "The system cannot find the file specified" when an assembly file was temporarily inaccessible during weaving. Such an error could also make PostSharp or the runtime silently select another build of the assembly, for example themsilbuild instead of theamd64build. - #149 A file locked with a byte-range lock, and a file to which access is temporarily denied, are now retried like a file opened by another process. Every read of an assembly file, including the Global Assembly Cache query, is now retried.
- #147 Fixed the loading of an assembly image by the CLR host: a failed open of the file is now detected and reported with its original error instead of
error 6, and the shared image cache is now thread-safe and no longer blocks concurrent builds while one of them retries a locked file.
Resources
- Milestone
- Full Changelog: v2024.0.26...v2024.0.27
PostSharp 2026.0.17
PostSharp 2026.0.17 is based on v2026.0.16 and v2024.0.26.
This release forward-ports the upstream v2024.0.26 changes to the 2026.0 line: a license verification security fix, the fixes to concurrent weaving in the .NET Framework CLR host and the pipe server, several platform-binding and Windows PDB fixes, and support for PostSharpTrace="*".
Fixes
- #85 Fixed a
PS0264error when weaving a project that targetsnetcoreapp3.1on the .NET 10 SDK, whereSystem.Delegatewas resolved againstSystem.Private.CoreLib10.0.0.0 instead of the reference assemblies of the target framework.
Resources
- Milestone
- Milestone 2024.0.26 (upstream)
PostSharp 2024.0.26
PostSharp 2024.0.26 is based on v2024.0.25, plus the following changes.
Enhancements
- #82 Release notes are now published on the Releases page.
PostSharp-ReleaseNotes-<version>.htmlis no longer published with a release, andReleaseNotes.htmis no longer included in the compiler artifacts. Previously published release-notes files remain available.
Fixes
- #108 Fixed a license verification vulnerability.
- #138 Fixed builds that failed or stopped responding when several projects were woven concurrently by the .NET Framework CLR host and the pipe server, including intermittent
PS0264errors, builds that blocked indefinitely, cancellation that did not stop weaving, connection errors when the pipe server was busy, and an access violation when the compiler process exited after a successful build. - #121 Fixed a build failure with
AssertionFailedException"Encountered unknown implicit runtime framework" while binding platforms on the .NET Framework host. - #120 Fixed a build failure with
IndexOutOfRangeExceptionwhile writing the Windows PDB of a wovenasyncmethod or iterator. - #109 Fixed a build failure with
AssertionFailedExceptionwhen the .NET SDK advertises a targeting pack that is not installed. - #111 Fixed a build failure with
MSB4062on a prerelease package when the repository already defines thePostSharpVersionproperty. - #18
PostSharpTrace="*"now enables all trace categories whenPostSharpUsePipeServerisFalse, and an invalid trace category no longer crashes the compiler withTypeInitializationException.
Resources
- Milestone
- Full Changelog: v2024.0.25...v2024.0.26
PostSharp 2026.0.16
PostSharp 2026.0.16 is based on v2026.0.15 and v2024.0.25.
This release forward-ports the upstream v2024.0.25 changes to the 2026.0 line: the removal of the obsolete watermark task, and the fixes to the Customer Experience Improvement Program uploader.
Fixes
- #78 Fixed an unhandled
NullReferenceExceptionthat aborted the build when a referenced assembly declared an invalid multicast attribute. The build now fails on the PS0051 diagnostic that was already reported for it. - #79 Fixed the licensing service failing to initialize when the same license key is listed more than once in the registry, which left the Visual Studio extension permanently without a licensing state.
Resources
- Milestone
- Milestone 2024.0.25 (upstream)
PostSharp 2024.0.25
PostSharp 2024.0.25 is based on v2024.0.24, plus the following changes.
Enhancements
- #75 Removed the obsolete watermark task, which could abort a compilation with a PS0099 unhandled
NullReferenceExceptionwhen a user license entry was null. Woven assemblies no longer carry theEnhancedByPostSharpmanifest resource, PS0129 (This module has already been processed by PostSharp) is no longer emitted, andWatermarkTask,TaskNames.WatermarkandLicense.RequiresWatermarkhave been removed from the compile-time SDK.
Fixes
- #77 Fixed crashes of the Customer Experience Improvement Program uploader when the upload queue was empty, when a queued file was locked, or when BITS refused the transfer job. Orphan BITS jobs left behind by earlier failures are now cleaned up, a job that makes no progress for three days is abandoned, and the pending-report queue is capped at 50 files and 30 days.
Resources
- Milestone
- Full Changelog: v2024.0.24...v2024.0.25
PostSharp 2026.0.15
PostSharp 2026.0.15 is based on v2026.0.14 and v2024.0.24.
This release forward-ports the upstream v2024.0.24 fixes to the 2026.0 line: several metadata-reading defects in the compiler, a concurrency defect that could hang or crash the disposal of a caching back-end, a PS0264 assembly load failure on the cached deps.json path, and the EULA update to v2026-Q3.
Resources
- Milestone 2024.0.24 (upstream)
PostSharp 2026.0.14
PostSharp 2026.0.14 is based on v2026.0.13, plus the following changes.
Fixes
- #69 Fixed the loading of mixed-mode assemblies whose name starts with
System.but which carry a non-system public key token (for example System.Data.SQLite) in the .NET Framework build host, which failed with PS0264 (0x80131515).