Base solution for your next web application
Open Closed

Issues with v9.0.0 upgrade: No component for supporting the service HealthChecks.UI.Core.Data.HealthChecksDb was found #9298


User avatar
0
alharethi created

Hello,
I upgraded my project to the latest version from v8.7 and I ran into this issue below.

To make sure I did not do anything wron with my merge, I started fresh with the latest downloaded:

  1. Changed connection string in Web.Mvc project

  2. Ran migration

  3. Yarn/NPM commands to prepare solution

  4. Built the solution

  5. Ran the solution: no build errors. All 15 projects for Web.sln ran without issues.

  6. Getting stuck with the exception below.

An error occurred while starting the application.
ComponentNotFoundException: No component for supporting the service HealthChecks.UI.Core.Data.HealthChecksDb was found
Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, Arguments arguments, IReleasePolicy policy, bool ignoreParentContext)

ComponentNotFoundException: No component for supporting the service HealthChecks.UI.Core.Data.HealthChecksDb was found
Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, Arguments arguments, IReleasePolicy policy, bool ignoreParentContext)
Castle.MicroKernel.DefaultKernel.Resolve(Type service, Arguments arguments)
Castle.Windsor.WindsorContainer.Resolve(Type service)
Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.ResolveInstanceOrNull(Type serviceType, bool isOptional)
Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.GetServiceInternal(Type serviceType, bool isOptional)
Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.GetRequiredService(Type serviceType)
Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<T>(IServiceProvider provider)
HealthChecks.UI.Core.HostedService.UIInitializationHostedService.InitializeDatabase(IServiceProvider sp)
HealthChecks.UI.Core.HostedService.UIInitializationHostedService.StartAsync(CancellationToken cancellationToken)
Microsoft.AspNetCore.Hosting.HostedServiceExecutor.ExecuteAsync(Func<IHostedService, Task> callback, bool throwOnFirstFailure)
Microsoft.AspNetCore.Hosting.WebHost.StartAsync(CancellationToken cancellationToken)
Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, string startupMessage)
Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, string startupMessage)
Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token)
Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
LMS.Web.Startup.Program.Main(string[] args) in Program.cs
+
CreateWebHostBuilder(args).Build().Run();

Further details:
Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service HealthChecks.UI.Core.Data.HealthChecksDb was found
at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, Arguments arguments, IReleasePolicy policy, Boolean ignoreParentContext)
at Castle.MicroKernel.DefaultKernel.Resolve(Type service, Arguments arguments)
at Castle.Windsor.WindsorContainer.Resolve(Type service)
at Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.ResolveInstanceOrNull(Type serviceType, Boolean isOptional)
at Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.GetServiceInternal(Type serviceType, Boolean isOptional)
at Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.GetRequiredService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at HealthChecks.UI.Core.HostedService.UIInitializationHostedService.InitializeDatabase(IServiceProvider sp)
at HealthChecks.UI.Core.HostedService.UIInitializationHostedService.StartAsync(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Hosting.HostedServiceExecutor.ExecuteAsync(Func`2 callback, Boolean throwOnFirstFailure)
at Microsoft.AspNetCore.Hosting.WebHost.StartAsync(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String startupMessage)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String startupMessage)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
at LMS.Web.Startup.Program.Main(String[] args) in C:\Devel\LMS\src\LMS.Web.Mvc\Startup\Program.cs:line 12


5 Answer(s)
  • User Avatar
    0
    alharethi created

    I solved this issue by basically reverting to the previous version of HealthCheck package AspNetCore.HealthChecks.UI v 3.0.11 and deleted the other one completely. I am not sure what was the added benefits to upgrade and/or if the new package was tested prior to releasing v9.0.0

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Did you also add a reference to https://www.nuget.org/packages/AspNetCore.HealthChecks.UI.Client ?

    Could you try this with a brand new 9.0 Demo project ? We couldn't reproduce your problem. It might be related to your upgrade process.

  • User Avatar
    0
    alharethi created

    Hi ismcagdas,
    I lilterally downloaded my project from your site, ran yan/npm restore commands, changed my connection string and ran the project.

    I am running it on Windows 10, VS2019.

    I have not tried it using a new project demo. I am not sure how that would solve my problem. However, like I said, I downgraded back to previous version and it worked.

    Do you see any benefits in the latest upgrade for healthchecks?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @alharethi

    Sorry, I thought you have updated your existing solution, my bad.

    Do you see any benefits in the latest upgrade for healthchecks?

    Actually, I didn't check, you cna check changelogs here. I will create an issue and fix this problem. Thank you for your report.

  • User Avatar
    0
    musa.demir created

    Created an issue about it. You can follow the progress here: https://github.com/aspnetzero/aspnet-zero-core/issues/3440