Open sandboxFocusImprove this doc

LAMA5151: The InpcDiagnosticCommentVerbosity project property has an invalid value

Severity Warning
Reported by Metalama.Patterns.Observability
Message The project property '<PropertyName>' has invalid value '<PropertyValue>' and will be ignored. The value must <Reason>.

Cause

The [Observable] aspect can insert comments in the generated code to explain its decisions. The default verbosity of these comments is read from the InpcDiagnosticCommentVerbosity MSBuild property, when the project exposes this property to the compiler. The value must be an integer from 0 (no comments, the default) to 3 (the most verbose).

Metalama reports LAMA5151 when the property is set to a value that isn't an integer, or that's outside this range. In the message, <PropertyName> is the name of the property, <PropertyValue> is its value, and <Reason> describes the accepted values. Metalama then ignores the property and uses the default verbosity, 0.

This diagnostic depends on the MSBuild properties of the project, so it can't be shown in an example.

Resolution

Open the project file, or the Directory.Build.props file that sets the property, and do one of the following:

  • Set InpcDiagnosticCommentVerbosity to an integer between 0 and 3, for instance <InpcDiagnosticCommentVerbosity>2</InpcDiagnosticCommentVerbosity>.
  • Remove the property, or set it to an empty value, to use the default verbosity.

To set the verbosity for specific types or namespaces instead of the whole project, set the <xref:Metalama.Patterns.Observability.Configuration.ObservabilityTypeOptionsBuilder.DiagnosticCommentVerbosity> property from a fabric, using the ConfigureObservability method.

See also