Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.MemberAccessException if enricher has static ctor #260

Closed
Tolyandre opened this issue Apr 26, 2021 · 1 comment · Fixed by #263
Closed

System.MemberAccessException if enricher has static ctor #260

Tolyandre opened this issue Apr 26, 2021 · 1 comment · Fixed by #263
Labels

Comments

@Tolyandre
Copy link

If a custom enricher has a static ctor, configuration throws System.MemberAccessException : Type initializer was not callable.

There is how I discovered such behavior: Tolyandre/serilog-throw-context-enricher#2

To reproduce with a unit test:

  1. add empty static ctor to DummyThreadIdEnricher
  2. run test EnrichWithIsAppliedWithCustomEnricher

Actual behavior: test throws
Expected behavior: enricher is instantiated

@nblumhardt nblumhardt added the bug label Apr 26, 2021
@nblumhardt
Copy link
Member

Thanks for the report 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants