Skip to content

Releases

Metalama 2027.0.9-preview

Pre-release

Choose a tag to compare

Metalama 2027.0.9-preview fixes the introspection API (Metalama.Framework.Workspaces), which the MCP server and the LINQPad driver use.

Metalama 2027.0.9-preview is based on 2027.0.8-preview, plus the following changes.

Breaking Changes

  • #2417 Fixed a memory leak: unload_workspace in the MCP server, and the disposal of a workspace in any host, did not release the compilations of the workspace. A workspace no longer runs the Metalama source generator. As a consequence, Workspace.SourceCode no longer contains the partial declarations that the design-time pipeline generated for the members introduced by aspects. Workspace.TransformedCode is unchanged. The source code of a workspace is now the same as the source code that the compiler gives to Metalama.

Fixes

  • #2415 Fixed GetInboundReferences() returning an incomplete list, with no visible sign, when the solution references a package that contains an internal type with the same name as a public type, such as Xunit.Assert in Microsoft.Reactive.Testing. References in type constraints of methods, in type arguments of object creations, and in element types of array creations are now also found. When a syntax node cannot be indexed, Metalama now skips that node only and reports the new warning LAMA0094 at its location, instead of discarding the index of the whole project.
  • #2419 Fixed the telemetry settings of the MCP server and the LINQPad driver, which were evaluated at each telemetry event instead of once when the workspace was loaded. The warnings about the telemetry configuration, such as an invalid metalama.json file, now appear in the load diagnostics of the workspace.

Resources

Metalama 2027.0.8-preview

Pre-release

Choose a tag to compare

@gfraiteur gfraiteur released this 22 Nov 13:31
26da5a7

Metalama 2027.0.8-preview is the final preview of Metalama 2027.0. This build is code complete: the next 2027.0 builds will contain only fixes until the general availability release. Please test it with your projects and report any problem on GitHub.

Metalama 2027.0.8-preview is based on 2027.0.7-preview, plus the following changes.

Enhancements

  • #2384 Extended usage telemetry to the Metalama MCP server and the LINQPad driver. Each loaded workspace is reported at most once per day. The report follows the telemetry consent and the metalama.json opt-out, and it never contains a path, a name or the text of a query.

  • #2382 Extended the aspect test runner (Metalama.Testing.AspectTesting) to run the Roslyn analyzers of Metalama.Framework, so that their diagnostics appear in the expected output of the tests. The @RunAnalyzers test option controls this behavior.

  • #2380 The Metalama.Mcp package is now published as an MCP server package. NuGet.org lists it under the MCP server filter, and its package page provides the configuration for MCP clients.

  • #2377 Extended Metalama.Framework.Workspaces, the LINQPad driver and the MCP server to load .slnx solutions.

  • #2401 Improved the support of C# 15 unions: with Roslyn 5.12, the case types of a union and their order are now read from the compiler.

  • #2227 Removed the diagnostics that were never reported: LAMA0099, LAMA0524, LAMA0751, LAMA5108 and LAMA5109. LAMA1004 is now also reported at design time when an aspect introduces a member into an introduced declaring type.

  • #2387 Improved usage telemetry: each Metalama application now sends its own daily usage ping, instead of one ping per machine shared with the compiler.

Fixes

  • #2404 Fixed false LAMA0870 and LAMA0876 reports on aspect fields and properties marked with an advice attribute, such as [Introduce], [Template] or [IntroduceDependency].
  • #2400 Fixed the load failure of a compile-time project built against a retired Roslyn API version. Metalama now reports that the dependency must be recompiled.
  • #2399 Fixed the silent loss of an extension assembly that declares no reference for the current Roslyn version. Metalama now reports the new warning LAMA0093.
  • #2378 Fixed NuGet audit warnings (NU1902, NU1903) that Metalama.Framework.Workspaces, the LINQPad driver and the MCP server reported as load errors.
  • #2386 Fixed the reporting of unexpected exceptions in the MCP server and the LINQPad driver. These exceptions were never reported.
  • #2412 Fixed an intermittent InsufficientExecutionStackException when compiling a method body that contains a long chain of calls.

Resources

Metalama 2027.0.7-preview

Pre-release

Choose a tag to compare

Metalama 2027.0.7-preview is based on 2027.0.6-preview and 2026.1.33, plus the following changes.

Platform

  • Enhancement: #2341 Metalama now builds on Roslyn 5.12.0 GA and on the .NET 10.0.10 package line, which Visual Studio 2026 18.11 and 18.12 require. The roslyn-consolidated prerelease feed is no longer needed.

Introspection and tooling

  • New: #2300 The MetalamaWriteIntrospectionFile MSBuild property, which writes a .mlsym file describing the aspects, their transformations and their diagnostics, and the dotnet metalama introspect command, which reads it.
  • New: metalama-mcp, a local MCP server that runs C# queries over the Metalama code model of a solution. For details, see MCP server.
  • Fix: #2376 A false LAMA0033 skipped aspects derived from OverrideFieldOrPropertyAspect or OverrideMethodAspect in the MCP server, the LINQPad driver and Metalama.Framework.Workspaces when the referenced Metalama.Framework is older than the engine.

Interceptors and durable contracts

  • Enhancement: #2345 DurableTemplateInvocation, the durable counterpart of TemplateInvocation, and DurableArgumentResolver, for extensions that keep a template invocation across compilations.
  • Enhancement: #2343 The durable contract analyzer no longer reports LAMA0872 for an anonymous object or a collection initializer whose values are all durable, and it suggests a ToDurableRef or ToDurable conversion when one is available.
  • Fix: #2250 Every documented use of WithArgs in the interceptor API reported LAMA0872. Registrations made outside ForEachSite now have their own interfaces, and RedirectToSynthesizedMethod takes a DurableTemplateInvocation.

Aspects, fabrics and design time

  • Enhancement: #2021 Design-time code generation no longer emits linker-only code. This fixes a design-time CS0103 when an aspect explicitly implements an interface event as an event field with an initializer.
  • Fix: #2263 [Inheritable] aspects and annotations added before a low-level weaver were lost: they were missing from the transitive manifest, and aspects running after the weaver could not read the annotations.
  • Fix: #2100 A child aspect added through the adviser of a type fabric (amender.With(…).AddAspect<T>()) had an internal aggregate aspect as its predecessor, instead of the fabric instance.

Code model

  • Fix: #2358 SerializableDeclarationId.Resolve failed for constructors of generic types, for ordinary properties named Item, for pseudo setters, and for constructors in projects that do not reference Metalama.Framework.
  • Fix: #2357 Attributes, Depth and OverridingProperty of ITupleElement threw NotSupportedException.
  • Fix: #2356 ICompilation.ManagedResources threw NotImplementedException. It now returns an empty list.
  • Fix: #2355 ITypeParameter.TypeParameterKind threw AssertionFailedException for a type parameter of a C# 14 extension block.
  • Fix: #2354 INamespace.BelongsToCurrentProject and DeclaringAssembly threw NullReferenceException for a namespace that is resolved from a declaration ID and declared by several assemblies.

Caching

  • Enhancement: #2373 The layered caching backend now reads the dependencies of an item from the remote layer only when the caller requests them. This saves Redis round trips on every read that misses the local layer. (breaking change)
  • Enhancement: #2371 The default of RedisCachingBackendConfiguration.ReadCommandFlags is now PreferMaster when the backend has an L1 layer. A read from a replica could copy a just-removed item into the local cache, where it stayed until it expired. (breaking change)
  • Fix: #2070 Several defects of MemoryCachingBackend: an invalidation did not reach the items that depend on a removed or expired item, Clear cleared the whole shared IMemoryCache, the backend disposed an IMemoryCache it did not own, and ItemRemoved could be raised twice. (breaking change)
  • Fix: #2372 MemoryCachingBackend.SetItem kept the items that depend on a replaced value. It now removes them, as the Redis backend does, so the cached methods that call a refreshed method no longer return values computed from its previous result. (breaking change)
  • Fix: #2374 The local layer of the layered caching backend kept serving items that the remote layer had removed during an operation of the same node. (breaking change)
  • Fix: #2368 With the Redis backend, the invalidation of a dependency did not remove the items that depend on an intermediate item that had been removed or had expired. (breaking change)
  • Fix: #2369 With the Redis backend, SetItem over an expired value removed the dependent items or kept them, depending on whether the dependency garbage collector had run. (breaking change)
  • Fix: #2367 With the Redis backend, invalidating a cached method did not remove the cached values of the methods that called it.
  • Fix: #2370 With the Redis backend, the ItemRemoved event of an invalidated item carried the escaped form of its key, so other nodes kept the item in their L1 layer when its key contained %, {, } or :.

Resources

Metalama 2026.1.33

Choose a tag to compare

@gfraiteur gfraiteur released this 16 Nov 15:26

Metalama 2026.1.33 is based on 2026.1.32, plus the following changes.

This release updates Metalama.Compiler to 2026.1.22.

Fixes

  • #2330 Fixed long build times in projects whose dependency graph references the same assemblies through many paths. Adding some third-party packages could make a build up to 30 times slower.
  • #2344 Upgraded MessagePack, which is embedded in the design-time components, to 2.5.307 to address the vulnerability GHSA-qhrr-8q5h-9q3h.
  • #2058 An aspect class declared with the file modifier is now rejected with the new error LAMA0296, instead of failing the build with LAMA0113 and a compiler-generated type name.
  • #2213 Fixed the missing LAMA0517 error when a get-only auto-property template implements a writable interface property. The introduced property was silently made writable.
  • #2030 Fixed [Observable] generating code that does not compile (CS0019) for a property of a struct type that declares no equality operator. The setter now compares values with EqualityComparer<T>.Default.
  • #2029 Fixed an empty justification in LAMA0037 when an inheritable aspect is applied to a type that fails an ExceptForInheritance eligibility rule and cannot be inherited, for instance [Observable] on a struct.

Resources

Metalama 2027.0.6-preview

Pre-release

Choose a tag to compare

Metalama 2027.0.6-preview is based on 2027.0.5-preview and 2026.1.32, plus the following changes.

This release adds support for the .NET 11 SDK. It updates Metalama.Compiler to 2027.0.6-preview, which is based on Roslyn 5.12, the C# compiler of the .NET SDK 11.0.100, and fixes builds on .NET 10 SDKs older than the 10.0.4xx band.

New

  • #2314 Added the registration of Metalama Community outside Visual Studio: from the command line with metalama license community --reason <reason>, and from the browser-based setup pages.
  • #2319 Added documentation links to diagnostics: the IDE shows each Metalama diagnostic ID as a link to its documentation page. Custom diagnostics can set a link with the new HelpLinkUri property of DiagnosticDefinition.
  • #2325 Added an opt-in mode, METALAMA_DESIGN_TIME_HOST=VisualStudioInProcess, that hosts the Visual Studio design-time architecture in a test process, for testing IDE extensions without Visual Studio.

Enhancements

  • #2299 Improved LAMA0083: when the build that resolves compile-time reference assemblies times out, the log now contains that build's output.

Fixes

  • #1908 Metalama.Patterns.Caching now warns when an L1 cache wraps a non-blocking custom backend, which requires synchronized clocks on all machines sharing the backend.
  • #2297 Fixed a FileLoadException when Metalama.Framework.Workspaces loads a project in an application that resolves an older Microsoft.Extensions.Logging.Abstractions.

Resources

Metalama 2026.1.32

Choose a tag to compare

@gfraiteur gfraiteur released this 10 Nov 14:14

Metalama 2026.1.32 is based on 2026.1.31, plus the following changes.

Fixes

  • #2317 Fixed a crash of DevHub.exe (Visual Studio 2026) caused by an UnauthorizedAccessException when another process held the design-time touch file open. Errors in background design-time work are now reported instead of ending the process.
  • #2318 Fixed error LAMA0001 that broke a build about every 7 days, because the temp cleanup deleted the extracted Metalama assemblies while they were still in use.
  • #2322 Fixed IDE features such as CodeLens, the Aspect Explorer and the transformation preview, which could hang indefinitely while they waited for the design-time service.

Resources

Metalama 2026.1.31

Choose a tag to compare

@gfraiteur gfraiteur released this 29 Oct 15:04

Metalama 2026.1.31 is based on 2026.1.30, plus the following changes.

This release updates Metalama.Compiler to 2026.1.21, which disables Hot Reload by default for projects that use Metalama.

Enhancements

  • Added a link to Metalama AI Skills in the package READMEs.
  • Raised the System.Security.Cryptography.Pkcs dependency to 8.0.2 and System.Security.Cryptography.Xml to 8.0.5.

Fixes

  • #2248 Fixed a reference assembly that changed on every compilation of a project with inheritable aspects or options, which caused every dependent project to be recompiled.
  • #2249 Fixed the embedded compile-time project, which held absolute source paths that the compiler's PathMap did not remove. The same source built in two directories now produces the same assembly.
  • #2273 Fixed error CS0854 when a type with an AfterObjectInitializer initializer is created inside an expression tree. Metalama now leaves such call sites unchanged and reports the new warning LAMA0656.
  • #2274 Fixed AfterLastInstanceConstructor removing the parameterless constructor and changing constructor signatures, which broke Activator.CreateInstance, the new() constraint, serializers and dependency injection containers. A forwarding constructor now keeps the original signature, and AddInitializer accepts an IConstructorOverloadingStrategy.
  • #2275 Fixed IntroduceParameter with an IConstructorOverloadingStrategy creating no forwarding constructor for an implicit constructor, which removed the parameterless constructor.
  • #2276 Fixed AfterLastInstanceConstructor causing new S() to skip the explicit parameterless constructor of a struct.
  • #2279 Fixed AfterObjectInitializer not rewriting new T() in the body of an overridden method or in an expression-bodied property or indexer.
  • #2290 Fixed AfterObjectInitializer not rewriting new T() in a local function.
  • #2303 Fixed INamespace.Types.OfName and similar lookups sometimes returning nothing for a declared type when aspect callbacks run in parallel.
  • #2304 Fixed error CS0111 when an aspect overrides the synthesized ToString() (or another synthesized member) of a partial record with several parts.

Resources

Metalama 2027.0.5-preview

Pre-release

Choose a tag to compare

Metalama 2027.0.5-preview is based on 2027.0.4-preview, 2026.1.30 and 2026.1.31, plus the following changes.

This release updates Metalama.Compiler to 2027.0.5-preview.

New

  • #2313 Added the metalama preview <file.cs>... command, which prints the transformed and formatted code of one or a few files without building the project. The aspects run on the whole project, with the Metalama version that the project references, so aspects and fabrics declared in other files still apply.

Enhancements

  • #2264 Added warnings on mutable static fields of compile-time code, whose state persists across compilations at design time (LAMA0889–LAMA0891).
  • #2307 Added the LAMA0892 warning for a static read-only field of compile-time code whose type is immutable but not durable, such as AttributeConstruction. Such a field retains the objects of an old compilation and causes a memory leak at design time.
  • #2023 Added the LAMA0604 warning for a target framework that the build still accepts but that Metalama no longer supports. A project that targets net472 now reports it; net48 and net481 do not.
  • #1986 Improved the LAMA0232 error, which now says whether the template language version comes from the MetalamaTemplateLanguageVersion property or from the LangVersion of the project, capped by the compiler toolset.
  • SharpCrafters.Backstage#31 Improved the handling of locked files: the retries are now traced, and environment variables can set their timeout.
  • SharpCrafters.Backstage#36 Improved crash diagnostics on .NET: memory dumps are now written without the dotnet-dump tool.
  • Raised the versions of System.Security.Cryptography.Pkcs, System.Security.Cryptography.Xml and System.Formats.Asn1 referenced by the Metalama.Premium packages.

Fixes

  • #2281 Fixed the LAMA0037 eligibility error on a constructor parameter, which displayed the constructor with parameters that aspects introduced and that do not appear in the source code.
  • #2226 Fixed LAMA0042 being reported for a weaver aspect because of multi-layer aspects of a referenced library that the project does not use, such as the contract aspects of Metalama.Patterns.Contracts.
  • #2114 Fixed the silent loss of a contribution made through the amender of a fabric after AmendProject, AmendNamespace or AmendType has returned. Such a contribution now throws an InvalidOperationException, reported as LAMA0041, as for an aspect builder.
  • #2113 Fixed diagnostics of fabrics and validators being reported several times in a project that uses a low-level weaver aspect.
  • #2108 Fixed the loss of the transitive validators added by aspects in a project that uses a low-level weaver aspect: referencing projects did not receive them.
  • #2099 Fixed adviser.With( declaration ) accepting a declaration that is outside the target of the adviser. Such a call is now rejected.
  • #2231 Fixed AzureCacheSynchronizer processing cache invalidation messages after it was disposed.

Resources

Metalama 2026.1.30

Choose a tag to compare

@gfraiteur gfraiteur released this 13 Oct 13:21

Metalama 2026.1.30 is based on 2026.1.29, plus the following changes.

This release updates Metalama.Compiler to 2026.1.20.

Fixes

  • #2183 Fixed the disclosure of full license keys in the build log. When no license key satisfies a licensing requirement, the error message (LAMA0806) now identifies each considered key by its product name and license ID instead of the license key.
  • #2154 Fixed a template compiler crash after LAMA0105 was reported for a local declaration that mixes compile-time and run-time variables. The template compiler now reports only LAMA0105.
  • #2153 Fixed the eligibility justification of MustNotBeInterface(), which read "must not an interface" instead of "must not be an interface".

Resources

Metalama 2027.0.4-preview

Pre-release

Choose a tag to compare

Metalama 2027.0.4-preview is based on 2027.0.3-preview and 2026.1.29, plus the following changes.

This release updates Metalama.Compiler to 2027.0.4-preview.

Interceptors

  • New: Call-site interceptors, in the new Metalama.Extensions.Interceptors package. An aspect or a fabric redirects the calls to selected methods to an interceptor, through a fluent registration API. The interceptor is either an existing method or a method generated from a template. It can receive values that the call does not pass, such as a parameter of the calling member or caller information. The package requires a Metalama Community license, or any license of a higher edition. For details, see Interceptors.

Licensing

  • New: #946 Support for PostSharp license servers. A license can now be the URL of a license server, from which the build leases a license, on Windows, Linux and macOS. The new license acquire-lease command takes a lease on demand. An unattended build, such as one on a build server, never takes a seat. An http:// server URL causes a warning, because the request carries the user and machine names in cleartext.
  • New: #957 The MetalamaVcsCheck property, which skips licensing when no source file of the project is modified in git. AcquireLicenseOnChange requires a license only when a file is modified. FailOnChange fails the build when a file is modified. The default is Disabled.
  • Enhancement: SharpCrafters.Backstage#20 The error reported for a license key whose signature algorithm the platform does not support, such as an older key on macOS, now names the key and the licensing authority that signed it.
  • Enhancement: SharpCrafters.Backstage#13 A build that runs in a Windows container is now recognized as unattended, and the log now explains why a build is considered unattended.

Command-line tool, telemetry and platform

  • New: #2088 The metalama shutdown [--force] [--all] [--timeout <seconds>] command. It asks the compiler server and the MSBuild nodes to exit, ends the background processes of Metalama, and reports development environments without ending them unless --all is given. metalama kill is now another name for this command, and without --force it no longer ends a process that does not exit. (breaking change)
  • Fix: #2092 Usage telemetry slowed 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 (SharpCrafters.Backstage#26).
  • Fix: SharpCrafters.Backstage#17 Several defects on Linux and macOS:
    • Concurrent builds, such as the inner builds of a multi-targeted project, could fail with an IOException while they extracted the same files.
    • A build in a Linux container was not recognized as unattended under control groups v2.
    • Web pages, such as the setup wizard, never opened in the browser on Linux.
    • The process that started a build could be misidentified.
    • Looking up a process with many open files could hang on macOS.
  • Fix: SharpCrafters.Backstage#23 A registry change watcher could crash the process with ObjectDisposedException when it was disposed during its change callback.

Diagnostics

  • Enhancement: #2144 The messages and titles of many LAMA diagnostics that were inaccurate, imprecise or ungrammatical are corrected.
  • Fix: #2179 LAMA0120 named the InternalImplement attribute instead of the interface and its assembly.
  • Fix: #2176 LAMA0301 had the default category instead of Metalama.DesignTime.

Aspects and fabrics

  • Fix: #2225 MetalamaRequireOrderedAspects reported LAMA0035 for the aspects of referenced libraries that the project does not apply.
  • Fix: #2178 The MetalamaRequireOrderedAspects and MetalamaWriteLicenseUsageData MSBuild properties had no effect.
  • Fix: #2177 LAMA0068 was not reported for a C# error in compile-time code unless warning-level logging was enabled.
  • Fix: #2175 An abstract fabric base class caused LAMA0040 or LAMA0041.
  • Fix: #2174 LAMA0045 was reported on an abstract aspect with [EditorExperience(SuggestAsLiveTemplate = true)].
  • Fix: #2173 LAMA0405 was reported for a named argument that sets a property whose getter-only override inherits the setter.
  • Fix: #2172, #2171 The pipeline crashed, instead of reporting LAMA0261 or LAMA0257, when an aspect or its attribute was in a file that refers to Metalama only through fully qualified names.
  • Fix: #2152 For an aspect with several declarative advice members, only the eligibility rule of the last member was applied.

Templates

  • Fix: #2170 LAMA0237 was followed by an additional confusing error when a derived aspect overrides the template property.
  • Fix: #2167 Converting a compile-time multidimensional array to a run-time value caused CS1503 instead of LAMA0202.
  • Fix: #2166 A compile-time value of type object that cannot be serialized caused LAMA0041 with a crash report instead of LAMA0200.
  • Fix: #2157 The template compiler generated invalid code, instead of reporting LAMA0289, when the member after ?. is followed by a member access or an invocation.
  • Fix: #2156 Template syntax highlighting failed after LAMA0241 on an if condition.
  • Fix: #2155 The template compiler crashed when a template calls a member on a local whose type has a dynamic generic argument.
  • Fix: #2151 LAMA0280 was falsely reported on a deconstructing assignment to compile-time locals declared in the same run-time-conditional block.
  • Fix: #2150 LAMA0229 was reported only for a nested class, and not for a nested [RunTimeOrCompileTime] struct, interface, enum, delegate or record.

Compile-time serialization

  • Fix: #2169 A type that declares two nested serializers caused a design-time crash instead of LAMA0208.
  • Fix: #2168 A base serializer with only a private parameterless constructor caused a C# error in compile-time code instead of LAMA0207.

Advice and code model

  • New: #2140 AddParameter(IParameter) and AddTypeParameter(ITypeParameter) on the code model builders. These methods copy an existing parameter or type parameter, including its constraints, and optionally its attributes and default value.
  • Fix: #2139 Type parameters added through a builder could not be used in an array, a nullable type or a generic instance.
  • Fix: #2149 IntroduceFinalizer with OverrideStrategy.New crashed when the type already has a finalizer. LAMA0522 is now reported.
  • Fix: #2148 ImplementInterface with OverrideStrategy.Override rejected inherited override and abstract members with LAMA0529.
  • Fix: #2147 LAMA0518 was falsely reported when a get-only automatic property template implements an interface property explicitly.
  • Fix: #2146 LAMA0519 was reported instead of LAMA0517 when an interface property template lacks a required accessor.
  • Fix: #2145 ImplementInterface ignored inherited properties and events when it detected member conflicts or applied OverrideStrategy.Override.

Extensibility

  • Enhancement: #2115 The durability analysis of [Durable] now supports C# 15 unions. A union is durable when all its case types are durable.

Testing

  • Enhancement: #2075 Metalama.Testing.AspectTesting and Metalama.Testing.UnitTesting now use xunit.v3. Test projects must reference xunit.v3 and be executa...
Read more