Open sandboxFocusImprove this doc

LAMA0807: The license check ignored a license key

Severity Warning
Reported by Metalama.Licensing (the VerifyMetalamaLicense MSBuild task)
Message <the licensing warning message>

Cause

When a project references a Metalama Premium component, such as Metalama.Extensions.Validation or Metalama.Extensions.CodeFixes, an MSBuild task runs before the compiler and checks the licenses registered for the project. The licensing component reports every problem it finds along the way. The task reports the problems that don't fail the build by themselves as LAMA0807 warnings. When no license covers a component, it also reports the error LAMA0806.

The text of the message comes from the licensing component, so it varies. Typical messages are:

  • The license key set in the MSBuild property or environment variable named MetalamaLicense is invalid. <reason> The value of MetalamaLicense isn't a well-formed license key, for instance because it was truncated or mistyped.
  • Cannot use the license '<license>': <reason>. A license key is well-formed but can't be used, for instance because it has expired, isn't valid yet, has been revoked, or is for another product than Metalama. When the key doesn't come from your user profile, the message adds where it comes from.
  • The license key '<license>' is bound to the '<namespace>' namespace, but current project name is '<project>'. The license key is restricted to projects whose name starts with a given prefix, and the name of the current project doesn't.
  • A message explaining why a license string registered in your user profile can't be parsed.

The license key concerned is ignored. If another license covers the Premium components, the build succeeds with the warning. Otherwise, the build also reports LAMA0806 and fails.

This diagnostic depends on the license configuration of the machine, so it can't be shown in an example.

Resolution

Fix or remove the license key named in the message:

  • If the key set in MetalamaLicense is invalid, copy the complete license key again into the MSBuild property, the environment variable, or the CI secret.
  • If the license key has expired or has been revoked, register a current license key with metalama license register <LICENSE KEY>, or update the value of MetalamaLicense.
  • If the license key is bound to a namespace, make sure that the name of the project starts with this namespace, or use a license key that isn't bound to a namespace.
  • If you no longer use the license key, remove it: run metalama license list to see the licenses registered in your user profile, and remove the MetalamaLicense property or environment variable if it holds the key.

To understand which license keys the build considers, build with the MetalamaTraceLicensing MSBuild property set to True, for instance with dotnet build -p:MetalamaTraceLicensing=True -nodeReuse:false.

See also