Finding Missing Dependency on ArgumentNullException on InitializeServiceProvider
Is there an existing article or article request for this?
- [x] I have searched the existing resources
Describe the article you'd like
After some refactorings of an existing system I get the following exception I assume that i missed a reference to regsiter, but the exception doesn't tell me which type the expcetion is related to.
How can I find the type which is missing a instance and which instance it is?
System.ArgumentNullException: Value cannot be null. (Parameter 'instance') at Autofac.Core.Activators.ProvidedInstance.ProvidedInstanceActivator.GetType(Object instance) at Autofac.Core.Activators.ProvidedInstance.ProvidedInstanceActivator..ctor(Object instance) at Autofac.RegistrationExtensions.RegisterInstance[T](ContainerBuilder builder, T instance) at Autofac.Extensions.DependencyInjection.AutofacRegistration.Register(ContainerBuilder builder, IEnumerable
1 descriptors, Object lifetimeScopeTagForSingletons) at Autofac.Extensions.DependencyInjection.AutofacRegistration.Populate(ContainerBuilder builder, IEnumerable1 descriptors, Object lifetimeScopeTagForSingletons) at Autofac.Extensions.DependencyInjection.AutofacRegistration.Populate(ContainerBuilder builder, IEnumerable1 descriptors) at Autofac.Extensions.DependencyInjection.AutofacServiceProviderFactory.CreateBuilder(IServiceCollection services) at Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter1.CreateBuilder(IServiceCollection services) at Microsoft.Extensions.Hosting.HostBuilder.InitializeServiceProvider() at Microsoft.Extensions.Hosting.HostBuilder.Build()
hi
After some refactorings of an existing system I get the following exception
What changes have you made?
Had the same issue after updating the version of multiple other packages in my project. Updated Autofac to 8.2.0 too and it fixed the issue.
I got same problem, but it required me to update whole abp to 8.2.0, not only abp.autofac package
hi @quannguyen-smd-vault22
How to reproduce?
How to reproduce?
I'm don't have minimal project to re-procedure, but what I got is
- my initial project (long time ago) doesn't include all Tenant module (for all layers)
- I add all Tenant module back yesterday, when I start to run solution, it cause
System.ArgumentNullException: Value cannot be null. (Parameter 'instance')
Update Abp.Autofac to 8.2.0 will help the error more clear:
System.MissingMethodException: Method not found: 'System.Collections.Generic.List`1<System.Type> Volo.Abp.DependencyInjection.IOnServiceExposingContext.get_ExposedTypes()'.
so I decide to upgrade all other abp packages to 8.2.0, and the error disappear.
If you can share the minimal project, I can check it out.