Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading from 5.1.1 to 5.2.0 breaks API project #185

Closed
alastor09 opened this issue Sep 27, 2022 · 5 comments
Closed

Upgrading from 5.1.1 to 5.2.0 breaks API project #185

alastor09 opened this issue Sep 27, 2022 · 5 comments

Comments

@alastor09
Copy link

When updating from 5.1.1 to 5.2.0 i started getting this exception.

Autofac.Core.DependencyResolutionException: An exception was thrown while activating ?:Microsoft.Extensions.Hosting.IHost -> Microsoft.Extensions.Hosting.Internal.ApplicationLifetime -> Microsoft.Extensions.Logging.Logger`1[[Microsoft.Extensions.Hosting.Internal.ApplicationLifetime, Microsoft.Extensions.Hosting, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]] -> ?:Microsoft.Extensions.Logging.ILoggerFactory -> ?:Serilog.SerilogHostBuilderExtensions+RegisteredLogger.
---> System.TypeLoadException: Could not load type 'Serilog.Sinks.Http.Private.Sinks.HttpSink' from assembly 'Serilog.Sinks.Http, Version=5.2.1.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10' because the parent type is sealed.
@alastor09 alastor09 changed the title Upgrading from 5.1.1 to 5.2.0 breaks Upgrading from 5.1.1 to 5.2.0 breaks API project Sep 27, 2022
@nblumhardt
Copy link
Member

Thanks for the note @alastor09.

Adding a dependency on Serilog.Sinks.PeriodicBatching v3.1.0 will resolve this, until #186 is merged (which we'll do shortly).

@JochemE
Copy link

JochemE commented Sep 30, 2022

I run into the same issue just with another Sink (AwsCloudWatch), explicitly adding Serilog.Sinks.PeriodicBatching resolves it indeed.

This was the call stack that i got when i created the logger:

Could not load type 'Serilog.Sinks.AwsCloudWatch.CloudWatchLogSink' from assembly 'Serilog.Sinks.AwsCloudWatch, Version=4.0.171.0, Culture=neutral, PublicKeyToken=23b095b16108dcf5' because the parent type is sealed.
   at System.Reflection.RuntimeAssembly.GetExportedTypes()
   at System.Reflection.Assembly.get_ExportedTypes()
   at Serilog.Settings.Configuration.ConfigurationReader.<>c.<FindConfigurationExtensionMethods>b__32_1(Assembly a)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Serilog.Settings.Configuration.ConfigurationReader.FindConfigurationExtensionMethods(IReadOnlyCollection`1 configurationAssemblies, Type configType)
   at Serilog.Settings.Configuration.ConfigurationReader.FindSinkConfigurationMethods(IReadOnlyCollection`1 configurationAssemblies)
   at Serilog.Settings.Configuration.ConfigurationReader.ApplySinks(LoggerConfiguration loggerConfiguration)
   at Serilog.Settings.Configuration.ConfigurationReader.Configure(LoggerConfiguration loggerConfiguration)
   at Serilog.Configuration.LoggerSettingsConfiguration.Settings(ILoggerSettings settings)
   at Serilog.ConfigurationLoggerConfigurationExtensions.Configuration(LoggerSettingsConfiguration settingConfiguration, IConfiguration configuration, String sectionName, DependencyContext dependencyContext)

@nblumhardt
Copy link
Member

Thanks @JochemE .

v5.2.1 is out now, and fixes this: https://github.com/datalust/serilog-sinks-seq/releases/tag/v5.2.1

🎉

@nblumhardt
Copy link
Member

It looks like NuGet.org is taking longer than usual to index the package - hopefully it pops up soon, I'll keep an eye on it.

@JochemE
Copy link

JochemE commented Sep 30, 2022

I see it on nuget and our CI build is green 💚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants