This repository serves as a template for setting up Fody in-solution weaving. It demonstrates how to structure a solution that implements custom Fody weavers within the same solution where they are used.
.
├── Fody-in-solution.sln
├── Main
├── Mapper
└── Weavers
- Main: The main program that utilizes the weaved assemblies
- Weavers: Contains the custom Fody weaver implementation
- Mapper: The library project that is being weaved with the custom weaver
The Mapper.csproj
requires specific configuration for Fody to properly detect and apply the weaver:
<ItemGroup>
<PackageReference Include="Fody" Version="6.6.0" PrivateAssets="all" />
</ItemGroup>
<!-- These are required for Fody to detect and apply the weaver -->
<!-- See: https://github.com/Fody/Home/blob/master/pages/in-solution-weaving.md -->
<ItemGroup>
<ProjectReference Include="..\Weavers\Weavers.csproj" />
<WeaverFiles Include="..\Weavers\bin\Debug\netstandard2.0\Weavers.dll" LogLevel="Info"/>
</ItemGroup>
- Clone this repository
- Open
Fody-in-solution.sln
in your preferred IDE - Build the solution to ensure all dependencies are restored
- The Weavers project will automatically be applied to the Mapper project during build
This template is provided under the MIT License. Feel free to modify and use it in your own projects.