| Severity | Error |
| Reported by | Metalama.Licensing (the VerifyMetalamaLicense MSBuild task) |
| Message | <the licensing error message> |
Cause
Some Metalama packages are Metalama Premium components and require a commercial license: Metalama.Extensions.Validation (also used by Metalama.Extensions.Architecture), Metalama.Extensions.CodeFixes, and the Azure and Redis back-ends of Metalama.Patterns.Caching. When a project references one of these packages, an MSBuild task runs before the compiler and checks that a license registered for the project covers each of these components.
The task reports LAMA0806 when no license covers a component, and the build fails. The text of the message comes from the licensing component, so it varies, but it's typically:
The component '<component>' is not licensed. It requires one of the following products: <products>.
The message then says either that no valid license was found at all, or how many license keys were considered without any of them being eligible.
The license keys come from the following sources, in order of priority: the MetalamaLicense MSBuild property or environment variable, the license registered in your user profile with the metalama tool, and the unattended license used on build servers. The Premium components are covered by Metalama Professional and Metalama Enterprise licenses, and by PostSharp Framework and PostSharp Ultimate licenses. Metalama Community and Metalama Free licenses don't cover them.
Before this error, the build often reports LAMA0807 warnings that explain why a license key was ignored, for instance because it's invalid, expired, or bound to another project name.
This diagnostic depends on the license configuration of the machine, so it can't be shown in an example.
Resolution
- Read the LAMA0807 warnings that precede the error, if any. They tell you why a registered license key couldn't be used.
- Register a license that covers the Metalama Premium components:
- On a development machine, register your license key with
metalama license register <LICENSE KEY>, or start an evaluation withmetalama license try. Runmetalama license listto see the licenses registered in your user profile. - On a build server, or to share the license with the whole team, set the
MetalamaLicenseMSBuild property or environment variable to the license key, for instance from a secret of your CI server.
- On a development machine, register your license key with
- If you don't need the Premium component, remove the package reference from the project.
To understand which license keys the build considers and why it rejects them, build with the MetalamaTraceLicensing MSBuild property set to True, for instance with dotnet build -p:MetalamaTraceLicensing=True -nodeReuse:false. The trace is written to the build log.