Diagnostics

Facette emits compile-time diagnostics to help you catch configuration errors early. All diagnostics use the FCT prefix.

Reference

CodeSeverityTitleDescription
FCT001ErrorType must be partialThe type annotated with [Facette] must be declared as partial.
FCT002ErrorInclude and Exclude conflictBoth Include and Exclude are specified on the same DTO, which is not allowed. Use one or the other.
FCT003ErrorSource type not foundThe SourceType passed to [Facette] could not be resolved. Check that the type exists and is accessible.
FCT004WarningProperty not found on sourceA property name in Include or Exclude doesn't exist on the source type.
FCT005WarningMapFrom property not foundThe SourcePropertyName in [MapFrom] doesn't exist on the source type.
FCT006WarningCircular referenceA nested DTO chain forms a cycle (e.g., A → B → A). Facette skips the cycle to prevent infinite recursion.
FCT007WarningFlattened path segment not foundA segment in a convention-flattened or dot-notation path couldn't be resolved on the source type.
FCT008WarningConvert method not foundThe Convert method specified in [MapFrom] wasn't found as a static method on the DTO type.
FCT009WarningConvertBack method not foundThe ConvertBack method specified in [MapFrom] wasn't found as a static method on the DTO type.
FCT010ErrorAmbiguous nested DTOMultiple DTOs target the same source type and Facette can't determine which to use. Specify NestedDtos on the parent DTO to resolve.
FCT011WarningEnum projection warningAn enum conversion (e.g., .ToString()) in a LINQ projection may not be translatable by EF Core.
FCT012InfoAttribute reconstruction skippedWhen CopyAttributes = true, an attribute on the source property couldn't be fully reconstructed and was skipped.
FCT013ErrorConditional method invalidThe method referenced by [MapWhen] wasn't found, isn't static, isn't parameterless, or doesn't return bool.
FCT099WarningInternal generator errorAn unexpected error occurred during code generation. Please report it.

Treating warnings as errors

You can promote Facette warnings to errors in your project file:

<PropertyGroup>
  <WarningsAsErrors>FCT004;FCT005;FCT006;FCT007;FCT008;FCT009;FCT011</WarningsAsErrors>
</PropertyGroup>

Suppressing diagnostics

To suppress specific diagnostics:

<PropertyGroup>
  <NoWarn>FCT011;FCT012</NoWarn>
</PropertyGroup>