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

Error Could not load file or assembly 'Serilog.Exceptions, Culture=neutral, PublicKeyToken=null' #922

Open
albertoferrazzoli opened this issue Jan 14, 2025 · 0 comments
Labels
bug Issues describing a bug or pull requests fixing a bug.

Comments

@albertoferrazzoli
Copy link

Describe the bug

When Serilog.Exceptions is configured only in appsettings.json (not in code) we get a runtime load error
Could not load file or assembly 'Serilog.Exceptions, Culture=neutral, PublicKeyToken=null'
As Serilog.Exceptions have a strong name, PublicKeyToken != null and CLR cannot find proper assembly to load.

Steps to reproduce

  1. configure appsettings.json to load Serilog.Exceptions
    "Serilog": {
    "Using": [ "Serilog.Exceptions" ],
    "Enrich": [
    "WithExceptionDetails",
    ]
    }
  2. Ensure to not explicitly declare WithExceptionDetails in code to avoid explicit load os Serilog.Exceptions assembly
  3. Start the application

Expected behaviour

We expect the application to start when Serilog.Exceptions is configured only in appsettings.json.

@albertoferrazzoli albertoferrazzoli added the bug Issues describing a bug or pull requests fixing a bug. label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug or pull requests fixing a bug.
Projects
None yet
Development

No branches or pull requests

1 participant