Skip to content

alexb5dh/BeforeFieldInit.Fody

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

BeforeFieldInit.Fody

Fody addin.

Forces IL beforefieldinit attribute on types decorated with custom BeforeFieldInit attribute.

Usage

  1. Define custom BeforeFieldInit attribute:

    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false)]
    public class BeforeFieldInitAttribute : Attribute
    {
    }
  2. Add new attribute to your class:

    [BeforeFieldInit]
    public class MyClass
    {
        static MyClass()
        {
            // Initialization code goes here...
        }
    }

Nuget package

Coming soon...

Links

Introduction to Fody

C# and beforefieldinit

About

Fody addin for controlling MSIL beforefieldinit attribute.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published