.net 8 core приложение. при запуске
var builder = Host.CreateApplicationBuilder(args);
var host = builder.Build();
host.Run();
получаю такую ошибку. Как понять где ошибка?
System.AggregateException: Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Routing.Matching.DfaMatcherBuilder Lifetime: Transient ImplementationType: Microsoft.AspNetCore.Routing.Matching.DfaMatcherBuilder': Unable to resolve service for type 'System.Diagnostics.DiagnosticSource' while attempting to activate 'Microsoft.AspNetCore.Mvc.Razor.RazorPageActivator'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorCollectionProvider Lifetime: Singleton ImplementationType: Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider': Unable to resolve service for type 'System.Diagnostics.DiagnosticSource' while attempting to activate 'Microsoft.AspNetCore.Mvc.Razor.RazorPageActivator'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Mvc.Infrastructure.IActionSelector Lifetime: Singleton ImplementationType: Microsoft.AspNetCore.Mvc.Infrastructure.ActionSelector': Unable to resolve service for type 'System.Diagnostics.DiagnosticSource' while attempting to activate 'Microsoft.AspNetCore.Mvc.Razor.RazorPageActivator'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Mvc.ActionConstraints.ActionConstraintCache Lifetime: Singleton ImplementationType: Microsoft.AspNetCore.Mvc.ActionConstraints.ActionConstraintCache': Unable to resolve service for type 'System.Diagnostics.DiagnosticSource' while attempting to activate 'Microsoft.AspNetCore.Mvc.Razor.RazorPageActivator'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Routing.MatcherPolicy Lifetime: Singleton ImplementationType: Microsoft.AspNetCore.Mvc.Routing.ActionConstraintMatcherPolicy': Unable to resolve service for type 'System.Diagnostics.DiagnosticSource' while attempting to activate 'Microsoft.AspNetCore.Mvc.Razor.RazorPageActivator'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Mvc.Infrastructure.IActionInvokerFactory Lifetime: Singleton ImplementationType: Microsoft.AspNetCore.Mvc.Infrastructure.ActionInvokerFactory': No constructor for type 'Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvokerProvider' can be instantiated using services from the service container and default values.) (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Mvc.Abstractions.IActionInvokerProvider Lifetime: Transient ImplementationType: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvokerProvider': No constructor for type 'Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvokerProvider' can be instantiated using services from the service container and default values.) (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[Microsoft.AspNetCore.Mvc.VirtualFileResult] Lifetime: Singleton ImplementationType: Microsoft.AspNetCore.Mvc.Infrastructure.VirtualFileResultExecutor': Unable to resolve service for type 'Microsoft.AspNetCore.Hosting.IWebHostEnvironment' while attempting to activate 'Microsoft.AspNetCore.Mvc.Infrastructure.VirtualFileResultExecutor'.)