Skip to content

Releases: postsharp/PostSharp.Public

PostSharp 2027.0.2-preview

Pre-release

Choose a tag to compare

@gfraiteur gfraiteur released this 03 Oct 08:56

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 an AdviceArgs object 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 with InvalidProgramException. 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 TelemetryEnabled property to False in the postsharp.config file 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 the TelemetryEnabled property (postsharp/PostSharp.Public#188). A file that cannot be read is reported as a build warning.

Enhancements

  • #192 In a declarative aspect, [SelfPointcut] and Master can 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.Tool package, which was missing from 2027.0.1-preview, is now published, so dotnet tool install -g PostSharp.Tool installs the postsharp command line tool.
  • #182 Warnings about the repository configuration, for example a postsharp.config file 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 COMException when 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

Pre-release

Choose a tag to compare

@gfraiteur gfraiteur released this 29 Sep 17:16

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.0 and net9.0 are no longer supported target frameworks, and the packages no longer ship assets for them. net10.0 and net11.0 are supported, and the minimum SDK at build time is the .NET 10 SDK.
  • #114 Removed the PostSharp Options application (PostSharp.Settings.UI.exe and PostSharp.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. Set PostSharpDisableUserInterface to True to 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.Sdk package. PostSharp.Compiler.Common and PostSharp.Compiler.Engine now only depend on it.
  • #145 Builds on Windows build agents now use the pipe server, which keeps running after the build. Set PostSharpUsePipeServer=False to restore the former behaviour. PostSharpAllowPipeServerWhenUnattended is obsolete.

New

  • #119 Added the postsharp command 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 shutdown also stops the .NET build servers (dotnet build-server shutdown, the VBCSCompiler server and the MSBuild nodes) and the background worker and notifier. Without --force, a process that does not exit is reported as still running. postsharp kill is 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 closed while 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, InvalidateDependency or CleanUpAsync, which kept a CPU core busy and ignored the cancellation token.
  • #160 Fixed a NullReferenceException in MultiplexerBackend when a child logging backend creates no transaction.

Resources

PostSharp 2026.0.18

Choose a tag to compare

@gfraiteur gfraiteur released this 26 Sep 11:03

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

PostSharp 2024.0.27

Choose a tag to compare

@gfraiteur gfraiteur released this 26 Sep 11:02

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, LA0014 and PS0264 are now followed by a PS0265 message 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 with PostSharpTrace=AssemblyBinder. The trace also distinguishes a missing file from a file that cannot be accessed. A FileNotFoundException or FileLoadException that is not about an assembly is now reported as PS0099 with its message, instead of PS0264.

Fixes

  • #148 Fixed intermittent LA0014 and PS0264 errors 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 the msil build instead of the amd64 build.
  • #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

PostSharp 2026.0.17

Choose a tag to compare

@gfraiteur gfraiteur released this 23 Sep 13:48

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 PS0264 error when weaving a project that targets netcoreapp3.1 on the .NET 10 SDK, where System.Delegate was resolved against System.Private.CoreLib 10.0.0.0 instead of the reference assemblies of the target framework.

Resources

PostSharp 2024.0.26

Choose a tag to compare

@gfraiteur gfraiteur released this 23 Sep 13:11

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>.html is no longer published with a release, and ReleaseNotes.htm is 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 PS0264 errors, 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 IndexOutOfRangeException while writing the Windows PDB of a woven async method or iterator.
  • #109 Fixed a build failure with AssertionFailedException when the .NET SDK advertises a targeting pack that is not installed.
  • #111 Fixed a build failure with MSB4062 on a prerelease package when the repository already defines the PostSharpVersion property.
  • #18 PostSharpTrace="*" now enables all trace categories when PostSharpUsePipeServer is False, and an invalid trace category no longer crashes the compiler with TypeInitializationException.

Resources

PostSharp 2026.0.16

Choose a tag to compare

@gfraiteur gfraiteur released this 05 Aug 19:39

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 NullReferenceException that 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

PostSharp 2024.0.25

Choose a tag to compare

@gfraiteur gfraiteur released this 05 Aug 19:39

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 NullReferenceException when a user license entry was null. Woven assemblies no longer carry the EnhancedByPostSharp manifest resource, PS0129 (This module has already been processed by PostSharp) is no longer emitted, and WatermarkTask, TaskNames.Watermark and License.RequiresWatermark have 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

PostSharp 2026.0.15

Choose a tag to compare

@gfraiteur gfraiteur released this 24 Jul 06:25

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

PostSharp 2026.0.14

Choose a tag to compare

@gfraiteur gfraiteur released this 24 Jul 06:36

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).

Resources