Usage
August 11, 2019 ยท View on GitHub
Install using NuGet. See Using the package manager console for more info.
Fody ships in two parts:
- The core "engine" shipped in the Fody NuGet package
- Any number of "addins" or "weavers" which are all shipped in their own NuGet packages.
Install Fody
Since NuGet always defaults to the oldest, and most buggy, version of any dependency it is important to do a NuGet install of Fody after installing any weaver.
Install-Package Fody
Subscribe to Fody on Libraries.io to get notified of releases of Fody.
Add the NuGet Package
Install the package in the project:
Install-Package WeaverName.Fody
e.g.
Install-Package Virtuosity.Fody
Adding Fody to a project that generates a NuGet package
When Fody is added to a project that generates a NuGet package, the produced package will have a dependency on Fody. If this dependency needs to be removed from the generated .nupkg file, then, in the consuming .cproj project file, replace
<PackageReference Include="Fody" Version="xxx" />
with
<PackageReference Include="Fody" Version="xxx" >
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Add FodyWeavers.xml
To indicate what weavers run and in what order a FodyWeavers.xml file is used at the project level. It needs to be added manually. It takes the following form:
<Weavers>
<WeaverName/>
</Weavers>
e.g.
<Weavers>
<Virtuosity/>
</Weavers>
See Configuration for additional options.