You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure that single-file apps can find assemblies that contains sinks
Before this commit, when single-file app was detected, the behaviour was to fallback on DLL scanning. But DLL scanning would not find anything for an app published as a single-file, by sheer definition of single-file app!
After this commit, an exception is thrown if the app is published as a single-file AND no `Serilog:Using` section is defined in the configuration. The error message explains that either a `Serilog:Using` section must be added or show how to explicitly configure assemblies through the `ConfigurationReaderOptions`.
varmessage=$"The application is published as single-file and no {usingSection.Path} configuration section is defined.{Environment.NewLine}"+
376
+
$"Either add a {usingSection.Path} section or explicitly specify assemblies that contains sinks and other types through the reader options. For example:{Environment.NewLine}"+
377
+
$"var options = new ConfigurationReaderOptions(typeof(ConsoleLoggerConfigurationExtensions).Assembly, typeof(SerilogExpression).Assembly);{Environment.NewLine}"+
378
+
"new LoggerConfiguration().ReadFrom.Configuration(configuration, options);";
0 commit comments