C#C
C#11mo ago
its0mar

System.AggregateException: 'Some services are not able to be constructed

System.AggregateException
  HResult=0x80131500
  Message=Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: ServiceContracts.IPostService Lifetime: Scoped ImplementationType: Services.PostService': Unable to resolve service for type 'Repository.UserRepository' while attempting to activate 'Repository.ReactRepository'.) (Error while validating the service descriptor 'ServiceType: RepositoryContracts.IReactRepository Lifetime: Scoped ImplementationType: Repository.ReactRepository': Unable to resolve service for type 'Repository.UserRepository' while attempting to activate 'Repository.ReactRepository'.)
  Source=Microsoft.Extensions.DependencyInjection
  StackTrace:
   at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(ICollection`1 serviceDescriptors, ServiceProviderOptions options)
   at Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(IServiceCollection services, ServiceProviderOptions options)
   at Microsoft.Extensions.Hosting.HostApplicationBuilder.Build()
   at Microsoft.AspNetCore.Builder.WebApplicationBuilder.Build()
   at Program.<Main>$(String[] args) in C:\Users\Omar\Desktop\ZeroBlog\ZeroWebApp\ZeroWebApp\Program.cs:line 61

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
InvalidOperationException: Error while validating the service descriptor 'ServiceType: ServiceContracts.IPostService Lifetime: Scoped ImplementationType: Services.PostService': Unable to resolve service for type 'Repository.UserRepository' while attempting to activate 'Repository.ReactRepository'.

Inner Exception 2:
InvalidOperationException: Unable to resolve service for type 'Repository.UserRepository' while attempting to activate 'Repository.ReactRepository'.
Was this page helpful?