nblumhardt / autofac-serilog-integration

Contextual logger injection for Autofac using Serilog
Apache License 2.0
70 stars 25 forks source link

System.MissingMethodException: Method not found: 'Void Autofac.Core.IComponentRegistration.add_Preparing #42

Closed sonsy-soft closed 4 years ago

sonsy-soft commented 4 years ago

when I upgrade Autofac to vsesion 6.0.0 I got the exception

System.MissingMethodException: Method not found: 'Void Autofac.Core.IComponentRegistration.add_Preparing(System.EventHandler1<Autofac.Core.PreparingEventArgs>)'. at AutofacSerilogIntegration.ContextualLoggingModule.AttachToComponentRegistration(IComponentRegistryBuilder componentRegistry, IComponentRegistration registration) at Autofac.Module.<AttachToRegistrations>b__4_0(Object sender, ComponentRegisteredEventArgs e) at Autofac.Core.Registration.ComponentRegistryBuilder.add_Registered(EventHandler1 value) at Autofac.Module.AttachToRegistrations(IComponentRegistryBuilder componentRegistry) at Autofac.Module.Configure(IComponentRegistryBuilder componentRegistry) at Autofac.ContainerBuilder.Build(IComponentRegistryBuilder componentRegistry, Boolean excludeDefaultModules) at Autofac.ContainerBuilder.Build(ContainerBuildOptions options) at Autofac.Extensions.DependencyInjection.AutofacServiceProviderFactory.CreateServiceProvider(ContainerBuilder containerBuilder) at Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter`1.CreateServiceProvider(Object containerBuilder) at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider() at Microsoft.Extensions.Hosting.HostBuilder.Build()

augustoproiete commented 4 years ago

Are you using AutofacSerilogIntegration 4.0.0? If yes, then that error is expected (see #39)

Support for Autofac 6.0.0 is currently in-progress (see #40)

You might want to try the latest pre-release build (5.0.0-dev-00050 as of this writing)

sonsy-soft commented 4 years ago

thanks. I didn't know version 6.0.0 is in progress be success.