Fody addin.
Forces IL beforefieldinit attribute on types decorated with custom BeforeFieldInit attribute.
-
Define custom BeforeFieldInit attribute:
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false)] public class BeforeFieldInitAttribute : Attribute { }
-
Add new attribute to your class:
[BeforeFieldInit] public class MyClass { static MyClass() { // Initialization code goes here... } }
Coming soon...