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 eliminate that plumbing code through an extensible add-in model.
- Projects using the project.json.
- Projects using the xproj.
- Projects mixing the old
.csproj
format with new<PackageReference>
nodes.
To tell the difference bewteen the old and new csproj formats.
The old format starts with
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
The new format starts with
<Project Sdk="Microsoft.NET.Sdk">
For all these scenarios is it instead recommended to move to the new VS 2017 SDK style projects.
References
- Bye-Bye Project.json and .xproj and welcome back .csproj
- Project.json to MSBuild conversion guide
- Migrate from project.json to new VS 2017 SDK style projects
https://www.nuget.org/packages/Fody/
PM> Install-Package Fody
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 hashes to your Assemblies, even make all your string comparisons case insensitive.
- 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, .net 4.6, Silverlight 4, Silverlight 5, Windows Phone 7, Windows Phone 8, Metro on Windows 8, Mono, MonoTouch, MonoDroid and PCL
See SampleUsage for an introduction on using Fody.
The name "Fody" comes from the small birds that belong to the weaver family Ploceidae.
- 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.
- Anotar Simplifies logging through a static class and some IL manipulation.
- AssertMessage Generates 'message' from sourcecode and adds it to assertion.
- AsyncErrorHandler Integrates error handling into async and TPL code.
- AutoDependencyProperty Generates WPF DependencyProperty boilerplate from automatic C# properties.
- AutoDI A framework for simplifying the creation of objects that only partially depend on resources in your favorite DI container.
- AutoLazy Automatically implements the double-checked locking pattern on specified properties and methods.
- BasicFodyAddin A simple project meant to illustrate how to build an addin.
- Caseless Change string comparisons to be case insensitive.
- Catel For transforming automatic properties into Catel properties.
- Cauldron Provides method, property and field interception. It also provides weavers for Cauldron.Core and Cauldron.Activator.
- ConfigureAwait Allows you to set the async ConfigureAwait at a global level for all your await calls.
- Costura For embedding references as resources.
- CryptStr Encrypts literal strings in your .NET assemblies.
- DependencyInjection automatic dependency injection for Ninject, Autofac and Spring.
- EmptyConstructor Adds an empty constructor to classes even if a non empty one is defined.
- EmptyStringGuard Adds empty string argument checks to an assembly.
- EnableFaking Allows faking your types without writing interfaces for testing purposes only.
- Equals Generate Equals, GetHashCode and operators methods from properties.
- Expose Exposes members and optionally implements interface of a field declared in class.
- ExtraConstraints Facilitates adding constraints for Enum and Delegate to types and methods.
- FactoryId Simplifies the implementation of Factory Method Pattern
- Fielder Converts public fields to public properties.
- FodyDependencyInjection Dependency injection with Fody add-ins.
- Freezable Implements the Freezable pattern.
- InfoOf Provides
methodof
,propertyof
andfieldof
equivalents oftypeof
. - Ionad Replaces static method calls.
- Janitor Simplifies the implementation of IDisposable.
- LoadAssembliesOnStartup Loads references on startup by using the types in the module initializer
- MethodCache Caches return values of methods decorated with a
CacheAttribute
. - MethodDecorator Decorate arbitrary methods to run code before and after invocation.
- MethodTimer Injects method timing code.
- ModuleInit Adds a module initializer to an assembly.
- Mutable Make F# setters for union types and eliminate need for
CLIMutable
attribute for records. - Mvid Adds the ability to specify the assembly MVID (Module Version Id).
- Nancy.ModelPostprocess Modify Nancy models after route execution but before serialization
- NullGuard Adds null argument checks to an assembly
- Obsolete Helps keep usages of ObsoleteAttribute consistent.
- Padded Adds padding to fight the false sharing problem.
- PropertyChanged Injects INotifyPropertyChanged code into properties.
- PropertyChanging Injects INotifyPropertyChanging code into properties.
- Publicize Converts non-public members to public hidden members.
- QueryValidator Validates your DB queries during a build.
- Realm Mobile database: a replacement for SQLite & ORMs.
- ReactiveUI Generates ReactiveUI
RaisePropertyChange
notifications for properties andObservableAsPropertyHelper
properties. - Resourcer Simplifies reading embedded resources from an Assembly.
- RomanticWeb Fody weaver plugin for RomanticWeb instrumentation.
- SemVer versions your assemblies according to SemVer based on your CVS commit messages.
- Spring Spring constructor configuration.
- StampSvn Stamps an assembly with SVN data.
- StaticProxy Helps proxy dynamic code emitting: Moq, FakeItEasy, Castle Dynamic, LinFu.
- SexyProxy Proxy generator with support for async patterns.
- SwallowExceptions Swallow Exceptions in targeted methods.
- ToString Generate
ToString
method from public properties. - Tracer Adds trace-enter and trace-leave log entries for selected methods.
- Undisposed Debugging tool to track down undisposed objects.
- Usable Adds using statements for local variables that have been created, and implement IDisposable.
- Validar Injects IDataErrorInfo or INotifyDataErrorInfo code into a class at compile time.
- Vandelay Simplifies MEF importing\exporting.
- Visualize Adds debugger attributes to help visualize objects.
- Virtuosity Change all members to virtual.
- WeakEvents Automatic publishing of weak events via compile time code weaving and a supporting runtime library.
- With Methods to return copies of immutable objects with one property modified.
- YALF Yet Another Logging Framework.
- Tail Adds a postfixed method call instruction to recursive calls.
The below addins are no longer maintained. Raise an issue in the specific project if you would like to take ownership.
- ArraySlice ArraySlice allows to build shared memory array views without performance impact. It uses IL manipulation to achieve the fastest implementation.
- Cilador Write your own mixins in C# for code reuse without inheritance.
- Commander Injects ICommand properties and implementations for use in MVVM applications.
- JetBrainsAnnotations Leverage JetBrains Annotations without the need for JetBrainsAnnotations.dll.
- Mixins A mixin is a class that provides a certain functionality to be inherited or just reused by a subclass.
- NameOf Provides strongly typed access to a compile-time string representing the name of a variable, field, property, method, event, enum value, or type.
- RemoveReference Facilitates removing references in a compiled assembly during a build.
- Scalpel Strips tests from an assembly.
- Seal mark all non-virtual(abstract, non-sealed) types as sealed by default.
- Stiletto Compile-time static analysis and optimization for the Stiletto IoC library.
- Stamp Stamps an assembly with git data.
Bird designed by Marco Hernandez from The Noun Project
- AddinSearchPaths
- DeployingAddinsAsNugets
- Home
- HowToWriteAnAddin
- InSolutionWeaving
- AssemblyVerification
- ModuleWeaver
- PdbReWritingAndDebugging
- SampleUsage
- Setup
- SignedAssemblies
- SupportedRuntimesAndIde
- TaskAddsAFlagInterface
- TaskCouldNotBeLoaded
- WeavingTaskOptions
- ThrowingAnExceptionFromAnAddin
- Mono Support
- Building From A Network Share
http://www.jetbrains.com/resharper/