Skip to content

InitializeEventHandlers aspect with events defined in interfaces #15

@Whathecode

Description

@Whathecode

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions