Framework-Class-Library-Extension
Framework-Class-Library-Extension copied to clipboard
InitializeEventHandlers aspect with events defined in interfaces
When there is an interface which defines an event within the assembly targeted by the InitializeEventHandlers aspect, compilation fails.
Unhandled exception (4.0.34.0, 32 bit, CLR 4.5, Release): System.NullReferenceException: Object reference not set to an instance of an object. at PostSharp.Sdk.AspectInfrastructure.TypeInitializationManager.^nCElfVTrtpDd.^Dpi1V+WW(MethodDefDeclaration _0) ...
A current workaround is to exclude the particular event in question by using [InitializeEventHandlers( AttributeExclude = true)]. This does not seem the aspect from being applied to implementing classes.