Category : serilog

Facing a strange issue when I run the .net 3.1 core web api using docker and use serilog public static void Main(string[] args) { var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build(); Log.Logger = new LoggerConfiguration().Enrich. FromLogContext() .CreateLogger() ; Log.Information("Application starting up"); CreateHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) ****//on removing this i’m able to launch ..

Read more

When I run my dotnet core web application in Docker I get error Unhandled exception. System.IO.FileLoadException: Could not load file or assembly ‘System.Configuration.ConfigurationManager, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’. The located assembly’s manifest definition does not match the assembly reference. (0x80131040) File name: ‘System.Configuration.ConfigurationManager, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ at System.Reflection.RuntimeAssembly.GetExportedTypes() at System.Reflection.Assembly.get_ExportedTypes() at Serilog.Settings.Configuration.ConfigurationReader.<>c.b__29_0(Assembly a) at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext() at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext() ..

Read more

Having issues with a brownfield application (asp .netcore) migrating to a windows container running on mcr.microsoft.com/dotnet/core/aspnet:3.1 accessing the registry. Specifically, I’ve tried to run the application and make a call and I’m getting the below: Caught exception while emitting to sink Serilog.Core.Sinks.RestrictedSink: System.Security.SecurityException: The source was not found, but some or all event logs could ..

Read more