serilog / serilog-settings-configuration

A Serilog configuration provider that reads from Microsoft.Extensions.Configuration
Apache License 2.0
446 stars 129 forks source link

FileNotFoundException when using Serilog.Settings.Configuration in an Azure Function in .NET 6 #297

Closed fgheysels closed 2 years ago

fgheysels commented 2 years ago

I 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 ?

image

fgheysels commented 2 years ago

I have worked around this for now by:

skomis-mm commented 2 years ago

Hi @fgheysels , workaround seems enough. Dup #294

fgheysels commented 2 years ago

It's a workaround but not a clean solution imho.

krzysiek-b commented 1 year ago

It seems not work any more on latest dotnet tools. Can anyone confirm?

fgheysels commented 1 year ago

It's a workaround but not a clean solution imho.

If I'm not mistaken, isolated Functions should solve this issue ?

sergiojrdotnet commented 1 year ago

@krzysiek-b I've tested today and it still working