diff --git a/docs/docs/getting-started/installation.mdx b/docs/docs/getting-started/installation.mdx index 73ec7ce35e..d1e9aaa169 100644 --- a/docs/docs/getting-started/installation.mdx +++ b/docs/docs/getting-started/installation.mdx @@ -19,7 +19,7 @@ All you need to do, to install Mapperly is to add a NuGet reference pointing to - {``} + {``} @@ -27,8 +27,6 @@ All you need to do, to install Mapperly is to add a NuGet reference pointing to dotnet add package Riok.Mapperly ``` -Make sure to set `PrivateAssets="all" ExcludeAssets="runtime"` on the added `PackageReference`. - @@ -36,16 +34,9 @@ Make sure to set `PrivateAssets="all" ExcludeAssets="runtime"` on the added `Pac Install-Package Riok.Mapperly ``` -Make sure to set `PrivateAssets="all" ExcludeAssets="runtime"` on the added `PackageReference`. - -:::info -`PrivateAssets="all"` ensures that projects referencing this project do not also get a reference to "Riok.Mapperly". -`ExcludeAssets="runtime"` ensures that the Mapperly .dll files are not copied to the build output (they are not needed at runtime). -::: - :::warning @@ -55,3 +46,17 @@ Checkout the latest stable version [here](https://mapperly.riok.app). ::: + +:::info +It is possible to remove Mapperly runtime references completely by setting `PrivateAssets="all"` and `ExcludeAssets="runtime"` on the `PackageReference`. +`PrivateAssets="all"` ensures that projects referencing this project do not also get a reference to `Riok.Mapperly`. +`ExcludeAssets="runtime"` ensures that the Mapperly .dll files are not copied to the build output. + +Removing the runtime dependency comes with the disadvantage that whenever the runtime tries +to load a referenced attribute from `Riok.Mapperly.Abstractions` a `FileNotFoundException` is thrown. +This is, for example, the case if `typeof(MyMapper).GetCustomAttributes()` is called. + +In Blazor Wasm applications `` can be added to lazily load `Riok.Mapperly.Abstractions` +and reduce the download size. +`Riok.Mapperly.Abstractions` will probably never be needed anyway. +:::