Skip to main content


Add the NuGet Package to your project

All you need to do, to install Mapperly is to add a NuGet reference pointing to the package Riok.Mapperly.

<PackageReference Include="Riok.Mapperly" Version="3.5.1" ExcludeAssets="runtime" PrivateAssets="all" />

Preserving the attributes at runtime

Mapperly removes the attribute references at compile time by default (they have the ConditionalAttribute). If you want to preserve the attribute references at runtime you can set the MSBuild variable MapperlyAbstractionsScope to runtime.


When preserving the attribute usages, the Mapperly package reference needs to include the runtime assets.
Make sure ExcludeAssets on the PackageReference does not include runtime.