This is a simple solution built as a starter for writing Fody addins.
See also Fody usage.
Install the BasicFodyAddin.Fody NuGet package and update the Fody NuGet package:
PM> Install-Package BasicFodyAddin.Fody
PM> Update-Package Fody
The Update-Package Fody
is required since NuGet always defaults to the oldest, and most buggy, version of any dependency.
Add <BasicFodyAddin/>
to FodyWeavers.xml
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
<BasicFodyAddin/>
</Weavers>
A project that contains any classes used for compile time metadata. Generally any usage and reference to this is removed at compile time so it is not needed as part of application deployment.
The project that does the weaving.
It outputs a file named BasicFodyAddin.Fody. The '.Fody' suffix is necessary for it to be picked up by Fody.
ModuleWeaver.cs is where the target assembly is modified. Fody will pick up this type during a its processing.
In this case a new type is being injected into the target assembly that looks like this.
public class Hello
{
public string World()
{
return "Hello World";
}
}
See ModuleWeaver for more details.
Fody addins are deployed as NuGet packages. The BasicFodyAddin.Fody builds the package for BasicFodyAddin as part of a build. The output of this project is placed in SolutionDir/nugets.
For more information on the NuGet structure of Fody addins see DeployingAddinsAsNugets
A target assembly to process and then validate with unit tests.
This is where you would place your unit tests.
The test assembly contains three parts.
Note that there is no reference to Fody nor are any Fody files included in the solution. Interaction with Fody is done by convention at compile time.
Lego designed by Timur Zima from The Noun Project