Skip to content

sscctech/Fody

 
 

Repository files navigation

Extensible tool for weaving .net assemblies

Introduction

Manipulating the IL of an assembly as part of a build requires a significant amount of plumbing code. This plumbing code involves knowledge of both the MSBuild and Visual Studio APIs. Fody attempts to elimination that plumbing code through an extensible add-in model.

Why?

This technique of "weaving" in new instructions is fantastically powerful. You can turn simple public properties into full INotifyPropertyChanged implementations, add checks for null arguments, add Git hashs to your Assemblies, even make all your string comparisons case insensitive.

Note: NotifyPropertyWeaver

Users of the NotifyPropertyWeaver extension who are migrating to Fody will want to use NuGet to Install the PropertyChanged.Fody package along with Fody itself to get the same functionality as before. This is because Fody is a general purpose weaver with plugins while NotifyPropertyWeaver was specific to one scenario. That scenario now lives in the PropertyChanged addin. See Converting from NotifyPropertyWeaver for more information

The plumbing tasks Fody handles

  • Injection of the MSBuild task into the build pipeline
  • Resolving the location of the assembly and pdb
  • Abstracts the complexities of logging to MSBuild
  • Reads the assembly and pdb into the Mono.Cecil object model
  • Re-applying the strong name if necessary
  • Saving the assembly and pdb

Fody Uses Mono.Cecil and an add-in based approach to modifying the IL of .net assemblies at compile time.

  • No install required to build
  • No attributes required
  • No references required
  • Supports .net 3.5, .net 4, .net 4.5, Silverlight 4, Silverlight 5, Windows Phone 7, Windows Phone 8, Metro on Windows 8, Mono, MonoTouch, MonoDroid and PCL

Visual Studio Addin

There is a Visual Studio addin

Usage

See SampleUsage for an introduction on using Fody.

Naming

The name "Fody" comes from the small birds that belong to the weaver family Ploceidae.

Tools and Products Used

Samples

  • BasicFodyAddin A simple project meant to illustrate how to build an addin.
  • FodyAddinSamples is a single solution that contains a working copy of every fody addin.

More Info

With thanks to

Resharper from Jetbrains

http://www.jetbrains.com/resharper/

Resharper.png

TeamCity from Jetbrains

http://www.jetbrains.com/TeamCity/

TeamCity.png

Codebetter

For supplying a build server

http://codebetter.com/

CodeBetter.png

About

Extensible tool for weaving .net assemblies

Resources

License

Stars

Watchers

Forks

Packages

No packages published