FileNotFoundException when using Serilog.Settings.Configuration in an Azure Function in .NET 6
See original GitHub issueI created an Azure Function which is running on .NET 6. My Azure Function uses Serilog for logging and I’m using Serilog.Settings.Configuration to read log settings from the configuration.
When running the Function, I run into this exception:
System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Extensions.DependencyModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.'
I do see that the Serilog.Settings.Configuration package has a dependency on Microsoft.Extensions.DependencyModel v3.0.0.0 but this might maybe conflict with .NET 6 ?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Error loading Serilog from IConfiguration in Azure Function
I've run into this, and found that if I keep the Microsoft.NET.Sdk.Functions dependency on 3.0.03, it works fine, even using .net6 and Azure...
Read more >Could not load file or assembly Microsoft.Extensions. ...
Azure Functions v4 net 6/ Serilog.AspNetCore 5.0.0. The Function runs just fine with Serilog.AspNetCore 4.2.0, which has a dependency to Serilog.Settings.
Read more >Windows 10 .Net 6 or .Net 7 runtime getting error Could not ...
Windows 10 .Net 6 or .Net 7 runtime getting error Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0.
Read more >System.IO.FileNotFoundException: 'Could not load file or ...
I have an application in .net core. the application was running fine, but the error started coming after I installed.
Read more >Thomas Ardal
Serilog and log4net are two very popular choices for logging messages from .NET applications. In this post, I'll show you how to configure...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have worked around this for now by:
It’s a workaround but not a clean solution imho.