Could not load file or assembly 'Serilog.Sinks.Console' or one of its dependencies

edx
edx
506 Points
24 Posts

I'm getting following error at:

public static class LoggerConfig
    {
        public static void Configure()
        {
            Log.Logger = new LoggerConfiguration()
                .ReadFrom.AppSettings("console")
                .ReadFrom.AppSettings("rollingFile")
                .CreateLogger();
        }
    }

System.IO.FileNotFoundException: 'Could not load file or assembly 'Serilog.Sinks.Console' or one of its dependencies. The system cannot find the file specified.'

Views: 14038
Total Answered: 2
Total Marked As Answer: 1
Posted On: 23-Jul-2019 04:36

Share:   fb twitter linkedin
It seems, some dependent assembly was not loaded. Try remove then install again from nuget package.
 - Rahul Maurya  28-Jul-2019 00:22
Answers
beginer
beginer
1544 Points
52 Posts
         

Hi, Try to re-install 'Serilog.Sinks.Console' package from nuget package manager. I think, this will resolved your issue.

Posted On: 28-Jul-2019 00:33
edx
edx
506 Points
24 Posts
         

Thanks guys,

I resolved assembly dependency by installing one by one dependent package from nuget package manager.

  • Serilog 2.8.0
  • Serilog.Settings.Configuration 3.1.0
  • Serilog.Extensions.Logging 2.0.4
  • Serilog.Sinks.File 4.0.0
  • Serilog.Sinks.Console 3.1.1
  • Serilog.Sinks.RollingFile 3.3.0
Posted On: 28-Jul-2019 00:36
great!
 - Raj  25-Oct-2023 03:25
 Log In to Chat