Skip to main content

Installation

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.0" 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.

<PropertyGroup>
<MapperlyAbstractionsScope>runtime</MapperlyAbstractionsScope>
</PropertyGroup>
info

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.