Open sandboxFocusImprove this doc

LAMA0118: The compile-time code changed since the last build

Severity Warning
Reported by Metalama.Framework
Message The compile-time type '<Type>' has been modified since the last build. Metalama will stop analyzing this solution until the next build, and you may get errors caused by the absence of generated code. To resume analysis, finish the work on all compile-time logic, then build the project (even if the run-time code still has issues).

Cause

At design time, Metalama runs your aspects and fabrics in the IDE to provide generated code, diagnostics, and code fixes. When you edit compile-time code, for instance an aspect class, a fabric, or a type marked with [CompileTime], Metalama can't use the modified code until it's compiled again. Metalama then pauses its design-time analysis of the project instead of running outdated or incomplete compile-time code.

While analysis is paused, Metalama reports LAMA0118 on the name of each modified compile-time type, <Type> in the message. It reports the warning only when no Metalama IDE extension is attached to show the paused state in the user interface, for instance in Rider or Visual Studio Code. Code that depends on generated code, like introduced members, can show errors in the meantime.

This diagnostic appears only in the IDE, so it can't be shown in an example.

Resolution

  1. Finish your changes to the compile-time code.
  2. Build the project, for instance with dotnet build. Build even if the run-time code still has errors.
  3. Metalama resumes the design-time analysis, and the warning disappears.

See also