Analyzer diagnostics
Mapperly emits several diagnostics:
Rule ID | Severity | Description |
RMG001 | Error | A mapping method has an unsupported signature. |
RMG002 | Error | No accessible parameterless constructor found. |
RMG003 | Warning | No overlapping enum members found. |
RMG004 | Warning | Ignored target member not found. |
RMG005 | Error | Mapping target member not found. |
RMG006 | Error | Mapping source member not found. |
RMG007 | Error | Could not map member. |
RMG008 | Error | Could not create mapping. |
RMG009 | Info | Cannot map to read only member. |
RMG010 | Info | Cannot map from write only member. |
RMG011 | Info | Cannot map to write only member path. |
RMG012 | Info | Source member was not found for target member |
RMG013 | Error | No accessible constructor with mappable arguments found |
RMG014 | Warning | Cannot map to the configured constructor to be used by Mapperly |
RMG015 | Info | Cannot map to init only member path |
RMG016 | Error | Init only member cannot handle target paths |
RMG017 | Warning | An init only member can have one configuration at max |
RMG018 | Error | Partial static mapping method in an instance mapper |
RMG020 | Info | Source member is not mapped to any target member |
RMG021 | Warning | Ignored source member not found |
RMG022 | Error | Invalid object factory signature |
RMG023 | Error | Mapping source member for a required target member not found |
RMG024 | Error | The reference handler parameter is not of the correct type |
RMG025 | Error | To use reference handling it needs to be enabled on the mapper attribute |
RMG026 | Info | Cannot map from indexed member |
RMG027 | Warning | A constructor parameter can have one configuration at max |
RMG028 | Error | Constructor parameter cannot handle target paths |
RMG029 | Error | Queryable projection mappings do not support reference handling |
RMG030 | Error | Reference loop detected while mapping to an init only member |
RMG031 | Warning | Reference loop detected while mapping to a constructor member |
RMG032 | Warning | The enum mapping strategy ByName cannot be used in projection mappings |
RMG033 | Info | Object mapped to another object without deep clone |
RMG034 | Error | Derived source type is specified multiple times, a source type may only be specified once |
RMG035 | Error | Derived source type is not assignable to parameter type |
RMG036 | Error | Derived target type is not assignable to return type |
RMG037 | Info | An enum member could not be found on the source enum |
RMG038 | Info | An enum member could not be found on the target enum |
RMG039 | Error | Enum source value is specified multiple times, a source enum value may only be specified once |
RMG040 | Error | A target enum member value does not match the target enum type |
RMG041 | Error | A source enum member value does not match the source enum type |
RMG042 | Error | The type of the enum fallback value does not match the target enum type |
RMG043 | Warning | Enum fallback values are only supported for the ByName and ByValueCheckDefined strategies, but not for the ByValue strategy |
RMG044 | Warning | An ignored enum member can not be found on the source enum |
RMG045 | Warning | An ignored enum member can not be found on the target enum |
RMG046 | Error | The used C# language version is not supported by Mapperly, Mapperly requires at least C# 9.0 |
RMG047 | Error | Cannot map to member path due to modifying a temporary value, see CS1612 |
RMG048 | Error | Used mapper members cannot be nullable |
RMG049 | Warning | Source member is ignored and also explicitly mapped |
RMG050 | Warning | Target member is ignored and also explicitly mapped |
info
Mapperly only emits updated source code on build. You won't see the updated mapper code or mapper diagnostics until you perform a build.
This is done for performance reasons, otherwise the IDE could become laggy.
Editorconfig
The severity of these diagnostics can be customized via an .editorconfig
file:
.editorconfig
[*.cs]
dotnet_diagnostic.{RuleID}.severity = error
dotnet_diagnostic.RMG020.severity = error