Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1.71 KB

README.md

File metadata and controls

54 lines (38 loc) · 1.71 KB

Fody In-Solution Weaving Template

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.

Project Structure

.
├── Fody-in-solution.sln
├── Main       
├── Mapper
└── Weavers 

Components

  • 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

Setup Requirements

Mapper Project Configuration

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>

Getting Started

  1. Clone this repository
  2. Open Fody-in-solution.sln in your preferred IDE
  3. Build the solution to ensure all dependencies are restored
  4. The Weavers project will automatically be applied to the Mapper project during build

Additional Resources

License

This template is provided under the MIT License. Feel free to modify and use it in your own projects.