Open sandboxFocusImprove this doc

LAMA0089: The Roslyn version of the compiler isn't supported

Severity Error
Reported by Metalama.Framework
Message Metalama requires Roslyn <MinimumVersion> or later, but the compiler is running Roslyn <HostVersion>, for which this build of Metalama embeds no implementation. No aspect has been applied to this project. Upgrade the .NET SDK, or use a version of Metalama that supports Roslyn <HostVersion>.

Cause

Metalama runs inside the C# compiler, and each build of Metalama embeds implementations for a range of Roslyn versions. The Roslyn version is determined by the .NET SDK, or by the version of Visual Studio, that builds the project.

Metalama reports LAMA0089 when the compiler runs a Roslyn version below the lowest one supported by the installed version of Metalama. In the message, <MinimumVersion> is that lowest version and <HostVersion> is the version of the compiler that builds your project. Metalama has no implementation to run, so it applies no aspect to the project. A silent build without aspects would produce a program that behaves differently from what you wrote, so Metalama fails the build instead.

This diagnostic depends on the version of the compiler installed on the machine, so it can't be shown in an example.

Resolution

Use one of the following options:

  • Upgrade the .NET SDK, or Visual Studio if you build from the IDE, to a version that includes the Roslyn version required by the message. If the repository has a global.json file, check that it doesn't pin an older SDK.
  • Use an older version of the Metalama.Framework package that supports the Roslyn version of your compiler. The Requirements article lists the supported platforms.

See also