Open sandboxFocusImprove this doc

General errors and warnings

Diagnostics about applying aspects, aspect classes and their attributes, eligibility, aspect ordering, fabrics, and the compilation pipeline.

Article Description
LAMA0001: Metalama failed with an unexpected exception Metalama failed with an unexpected exception, which indicates a bug in Metalama.
LAMA0003: The aspect doesn't support this kind of declaration The aspect is applied to a kind of declaration for which it doesn't implement IAspect.
LAMA0012: The invoked member receives the wrong number of arguments An invoker is called with a number of arguments that doesn't match the parameters of the invoked member.
LAMA0013: The invoked member receives too few arguments An invoker is called with too few arguments for a member that has a params parameter.
LAMA0018: A local function can't be invoked from generated code Generated code attempts to invoke a local function through the code model.
LAMA0019: An expression passed to an out or ref parameter isn't a variable An invoker passes an expression that isn't a variable to an out or ref parameter.
LAMA0020: The type can't be found Compile-time code requests a type that doesn't exist in the project or its references.
LAMA0021: The aspect order contains a cycle The aspect ordering specifications contain a cycle.
LAMA0022: A child aspect must be processed after its parent aspect An aspect adds a child aspect whose class is processed before the parent aspect class.
LAMA0025: The template name doesn't match any member The template name passed to an advice method doesn't match any member of the aspect class.
LAMA0027: An assembly required by compile-time code can't be found The compile-time code of a referenced assembly depends on an assembly that the project doesn't reference.
LAMA0032: Several templates have the same name A class defines several templates with the same name.
LAMA0033: The member used as a template doesn't have the [Template] attribute A member used as a template doesn't have the [Template] attribute.
LAMA0035: Two aspect layers aren't explicitly ordered Two aspect layers aren't explicitly ordered while the project requires ordered aspects.
LAMA0036: A template of the base class has the same name An aspect class defines a template with the same name as a template of its base class.
LAMA0037: The aspect can't be applied to the declaration The aspect can't be applied to a declaration that doesn't meet its eligibility conditions.
LAMA0038: A child aspect can be added only inside the parent's type or namespace An aspect or fabric adds a child aspect to a declaration outside its own type or namespace.
LAMA0039: A child aspect is added to an ineligible declaration An aspect or fabric adds a child aspect to a declaration that isn't eligible for this aspect.
LAMA0040: A fabric must have a public parameterless constructor A fabric or a compiler plug-in doesn't have a public parameterless constructor.
LAMA0041: Compile-time code throws an exception Compile-time code, such as an aspect, a template, or a fabric, throws an exception.
LAMA0042: A low-level aspect is ordered between two layers of another aspect A low-level aspect based on an aspect weaver is ordered between two layers of another aspect.
LAMA0043: An aspect suggests a code fix A hidden diagnostic that carries a code fix suggested by an aspect, fabric, or validator.
LAMA0044: An aspect or fabric can't set options outside of its scope An aspect or fabric sets options for a declaration outside of the type or namespace it targets.
LAMA0045: A live template aspect must have a parameterless constructor An aspect that can be used as a live template has no parameterless constructor.
LAMA0048: The type receiving introduced members must be partial Aspects introduce members into a type that isn't partial, so the IDE can't show them.
LAMA0049: Metalama failed with an unexpected exception it could contain Metalama failed with an unexpected exception that it could contain, which indicates a bug in Metalama.
LAMA0050: The weaver of an aspect can't be found The weaver required by a weaver-based aspect can't be found in the project.
LAMA0051: Metalama doesn't support the preview C# language version The project is compiled with the 'preview' C# language version, which Metalama doesn't support.
LAMA0052: The C# language version isn't supported The C# language version of the project or of the templates isn't supported by Metalama.
LAMA0053: The METALAMA preprocessor symbol is missing The METALAMA preprocessor symbol is missing in a project where Metalama is enabled.
LAMA0054: The project references an unsupported version of Metalama.Framework The project references several versions of Metalama.Framework, or a version that's too recent for the Metalama engine.
LAMA0055: An aspect can't add an aspect of its own type to a declaration processed before its target An aspect adds an aspect of its own type to a declaration that has already been processed, such as its declaring type.
LAMA0056: The selected code fix can't be found again A code fix selected in the IDE can't be found again when Metalama applies it.
LAMA0057: Metalama isn't enabled in the project Metalama starts processing a project in which it isn't enabled.
LAMA0059: An aspect class can't be generic A non-abstract aspect class has type parameters.
LAMA0060: A template can't return a reference A template member returns a reference.
LAMA0061: The referenced assembly was compiled with an incompatible version of Metalama A referenced assembly was compiled with a version of Metalama whose compile-time code format is incompatible.
LAMA0063: Base and current invocations are limited to members of the target type A template invokes a member of another type with InvokerOptions.Base or InvokerOptions.Current.
LAMA0064: The initializer of an introduced member can't be generated Metalama failed to generate the initializer expression of an introduced field, property, or event.
LAMA0065: The options can't be set on the declaration Options are set on a declaration that doesn't meet the eligibility conditions of the options class.
LAMA0066: The formatting of generated code is enabled The formatting of the generated code is enabled, which slows down the build.
LAMA0067: A static constructor can't be invoked A template tries to invoke a static constructor.
LAMA0068: The compile-time code contains C# errors The compile-time code of the project, such as an aspect or a fabric, contains C# errors.
LAMA0069: A diagnostic can be reported or suppressed only inside the type or namespace of the aspect or fabric An aspect or fabric reports or suppresses a diagnostic on a declaration outside its own type or namespace.
LAMA0070: An extension assembly can't be loaded Metalama can't load an extension assembly registered by a package or the project.
LAMA0071: The type arguments of a generic method can't be inferred A template invokes a generic method without type arguments, and Metalama can't infer them.
LAMA0072: A transitive aspect of a referenced assembly can't be resolved A referenced assembly contains a transitive aspect whose class is unknown to the current version of Metalama.
LAMA0073: The transformed code can't be parsed The text of a transformed file can't be parsed again, which indicates a code generation bug.
LAMA0074: The transformed code contains a syntax error The text of a transformed file contains a syntax error, which indicates a code generation bug.
LAMA0075: The metalama.json file is ignored A metalama.json repository configuration file is misplaced or malformed, so Metalama ignores it.
LAMA0076: Metalama can't write the crash report Metalama couldn't write the crash report of an unexpected exception.
LAMA0077: An aspect weaver is provided by two assemblies Two referenced assemblies provide the same aspect weaver.
LAMA0078: A project reference uses a version of Metalama that the IDE can't consume A project reference of the same solution was compiled with a version of Metalama that the IDE support can't consume.
LAMA0079: Two references provide the same compile-time assembly Two references of the project provide the same compile-time assembly.
LAMA0080: The METALAMA_PROJECT_* preprocessor symbol is missing The METALAMA_PROJECT_* preprocessor symbol that identifies the project is missing.
LAMA0081: Projects of the same solution use different versions of Metalama A project reference of the same solution was compiled with another version of Metalama.
LAMA0082: Metalama can't resolve the compile-time reference assemblies The build of the project that resolves the compile-time reference assemblies failed.
LAMA0083: The resolution of the compile-time reference assemblies timed out The build of the project that resolves the compile-time reference assemblies timed out.
LAMA0084: The compile-time target frameworks are invalid The MetalamaCompileTimeTargetFrameworks MSBuild property has an invalid value.
LAMA0085: Compile-time code holds a reference that keeps the compilation in memory An object kept by your compile-time code holds a reference that keeps a project snapshot in memory in the IDE.
LAMA0086: The analysis of memory retained by compile-time code is complete The memory-leak analysis enabled by MetalamaDiagnoseMemoryLeaks has completed and reports its summary.
LAMA0087: The transitive aspect manifest of a reference can't be read The transitive aspect manifest of a referenced assembly can't be read, so no aspect is inherited from it.
LAMA0088: The declaring type of an introduced member can't be resolved Metalama can't resolve the declaring type of a member introduced by an aspect, which indicates a bug in Metalama.
LAMA0089: The Roslyn version of the compiler isn't supported The Roslyn version of the compiler is older than the minimum version Metalama supports.
LAMA0090: Compile-time code requires a more recent C# language version A reference contains compile-time code built with a C# version newer than the compiler supports.
LAMA0091: An extension contribution can't be made after a low-level weaver An aspect makes an extension contribution after a low-level aspect weaver has run.
LAMA0099: The feature isn't supported yet A feature isn't supported yet. The current version of Metalama doesn't report this diagnostic.
LAMA0120: The interface can only be implemented by its own project A type implements an interface marked with [InternalImplement] outside of the project that declares it.
LAMA0320: Aspects can't be applied to source-generated code An aspect attribute is added to a declaration in source-generated code.
LAMA0401: The custom attribute type isn't available at compile time A custom attribute must be instantiated at compile time, but its type is run-time-only.
LAMA0405: Metalama can't set a property of the custom attribute Metalama can't find the setter of a property assigned in a compile-time custom attribute.