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

Finding Missing Dependency on ArgumentNullException on InitializeServiceProvider #21959

Open
1 task done
BoasE opened this issue Jan 21, 2025 · 1 comment
Open
1 task done

Comments

@BoasE
Copy link

BoasE commented Jan 21, 2025

Is there an existing article or article request for this?

  • 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, IEnumerable1 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()

@BoasE BoasE changed the title Finde Missing Depency on ArgumentNullException on InitializeServiceProvider Finding Missing Depency on ArgumentNullException on InitializeServiceProvider Jan 21, 2025
@BoasE BoasE changed the title Finding Missing Depency on ArgumentNullException on InitializeServiceProvider Finding Missing Dependency on ArgumentNullException on InitializeServiceProvider Jan 21, 2025
@maliming
Copy link
Member

hi

After some refactorings of an existing system I get the following exception

What changes have you made?

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

No branches or pull requests

2 participants