Code Monkey home page Code Monkey logo

basicfodyaddin's Introduction

Chat on Gitter NuGet Status

Icon

This is a simple solution built as a starter for writing Fody addins.

Usage

See also Fody usage.

NuGet installation

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 to FodyWeavers.xml

Add <BasicFodyAddin/> to FodyWeavers.xml

<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
  <BasicFodyAddin/>
</Weavers>

The moving parts

BasicFodyAddin Project

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.

BasicFodyAddin.Fody Project

The project that does the weaving.

Output of the project

It outputs a file named BasicFodyAddin.Fody. The '.Fody' suffix is necessary for it to be picked up by Fody.

ModuleWeaver

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.

Nuget construction

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

AssemblyToProcess Project

A target assembly to process and then validate with unit tests.

Tests Project

This is where you would place your unit tests.

The test assembly contains three parts.

No reference to Fody

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.

Icon

Lego designed by Timur Zima from The Noun Project

basicfodyaddin's People

Contributors

dradovic avatar ninlar avatar seesharper avatar simoncropp avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.