Open Closed

Missing method exception at health check after migrating to ABP10 #10306


User avatar
0
muglabb created
  • Exception message and full stack trace:

  • [09:49:42 FTL] Host terminated unexpectedly! Autofac.Core.DependencyResolutionException: An exception was thrown while activating HealthChecks.UI.Data.HealthChecksDb -> ?:Microsoft.EntityFrameworkCore.DbContextOptions1[[HealthChecks.UI.Data.HealthChecksDb, HealthChecks.UI.Data, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null]]. ---> System.MissingMethodException: Method not found: 'System.String Microsoft.EntityFrameworkCore.Diagnostics.AbstractionsStrings.ArgumentIsEmpty(System.Object)'. at Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(String value, String parameterName) at Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(String value, String parameterName) at Microsoft.EntityFrameworkCore.InMemoryDbContextOptionsExtensions.UseInMemoryDatabase(DbContextOptionsBuilder optionsBuilder, String databaseName, InMemoryDatabaseRoot databaseRoot, Action1 inMemoryOptionsAction) at Microsoft.EntityFrameworkCore.InMemoryDbContextOptionsExtensions.UseInMemoryDatabase(DbContextOptionsBuilder optionsBuilder, String databaseName, Action1 inMemoryOptionsAction) at Microsoft.Extensions.DependencyInjection.HealthChecksUIBuilderExtensions.<>c__DisplayClass0_0.<AddInMemoryStorage>b__0(DbContextOptionsBuilder options) in /home/runner/work/AspNetCore.Diagnostics.HealthChecks/AspNetCore.Diagnostics.HealthChecks/src/HealthChecks.UI.InMemory.Storage/HealthChecksUIBuilderExtensions.cs:line 13 at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.<>c__DisplayClass1_02.<AddDbContext>b__0(IServiceProvider _, DbContextOptionsBuilder b) at Microsoft.EntityFrameworkCore.Infrastructure.Internal.DbContextOptionsConfiguration1.Configure(IServiceProvider serviceProvider, DbContextOptionsBuilder optionsBuilder) at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.CreateDbContextOptions[TContext](IServiceProvider applicationServiceProvider) at Autofac.Extensions.DependencyInjection.AutofacRegistration.<>c__DisplayClass5_0.<Register>b__1(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Activators.Delegate.DelegateActivator.<ConfigurePipeline>b__2_0(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.DelegateMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Extensions.DependencyInjection.KeyedServiceMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) --- End of inner exception stack trace --- at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Pipeline.ResolvePipeline.Invoke(ResolveRequestContext context) at Autofac.Core.Resolving.Middleware.RegistrationPipelineInvokeMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Resolving.Middleware.SharingMiddleware.<>c__DisplayClass5_0.<Execute>b__0() at Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance(Guid id, Func1 creator) at Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance(Guid primaryId, Nullable1 qualifyingId, Func1 creator) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Pipeline.ResolvePipeline.Invoke(ResolveRequestContext context) at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest& request) at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest& request) at Autofac.Core.Resolving.ResolveOperation.Execute(ResolveRequest& request) at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest& request) at Autofac.Core.Lifetime.LifetimeScope.Autofac.IComponentContext.ResolveComponent(ResolveRequest& request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at HealthChecks.UI.Core.HostedService.UIInitializationHostedService.InitializeDatabaseAsync(IServiceProvider sp) in /home/runner/work/AspNetCore.Diagnostics.HealthChecks/AspNetCore.Diagnostics.HealthChecks/src/HealthChecks.UI/Core/HostedService/UIInitializationHostedService.cs:line 44 at HealthChecks.UI.Core.HostedService.UIInitializationHostedService.StartAsync(CancellationToken cancellationToken) in /home/runner/work/AspNetCore.Diagnostics.HealthChecks/AspNetCore.Diagnostics.HealthChecks/src/HealthChecks.UI/Core/HostedService/UIInitializationHostedService.cs:line 34 at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__14_1(IHostedService service, CancellationToken token) at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List1 exceptions, Func3 operation) at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at hybs.Web.Program.Main(String[] args) in C:\Projeler\HafriyatYonetimSistemi\hybs - V10\src\hybs.Web\Program.cs:line 47 [09:49:42 ERR] Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed. System.ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed. at Autofac.Core.Lifetime.LifetimeScope.ThrowDisposedException() at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest& request) at Autofac.Core.Lifetime.LifetimeScope.Autofac.IComponentContext.ResolveComponent(ResolveRequest& request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Volo.Abp.Localization.VirtualFiles.VirtualFileLocalizationResourceContributorBase.Initialize(LocalizationResourceInitializationContext context) at Volo.Abp.Localization.AbpStringLocalizerFactory.CreateStringLocalizerCacheItem(LocalizationResourceBase resource) at Volo.Abp.Localization.AbpStringLocalizerFactory.<>c__DisplayClass25_0.<CreateInternal>b__1(String _) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Volo.Abp.Localization.AbpStringLocalizerFactory.<>c__DisplayClass25_0.<CreateInternal>g__GetOrCreateLocalizer|0() at Volo.Abp.Localization.AbpStringLocalizerFactory.CreateInternal(String resourceName, LocalizationResourceBase resource, Boolean lockCache) at Volo.Abp.Localization.AbpStringLocalizerFactory.Create(Type resourceType, Boolean lockCache) at Volo.Abp.Localization.AbpStringLocalizerFactory.Create(Type resourceType) at Volo.Abp.LanguageManagement.External.ExternalLocalizationSaver.dUlcYdfqU7() at Volo.Abp.LanguageManagement.External.ExternalLocalizationSaver.SaveAsync() at Volo.Abp.LanguageManagement.External.ExternalLocalizationSaver.SaveAsync() at Volo.Abp.LanguageManagement.External.ExternalLocalizationSaver.SaveAsync() at Volo.Abp.LanguageManagement.External.ExternalLocalizationSaver.SaveAsync() at Volo.Abp.LanguageManagement.LanguageDynamicInitializer.jPs5fj3d6(CancellationToken ) at Polly.AsyncPolicy.<>c__DisplayClass44_0.<<ImplementationAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func3 action, Context context, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates1 shouldRetryResultPredicates, Func5 onRetryAsync, CancellationToken cancellationToken, Int32 permittedRetryCount, IEnumerable1 sleepDurationsEnumerable, Func`4 sleepDurationProvider, Boolean continueOnCapturedContext)

  • Steps to reproduce the issue: After migrating to 10 I started to get this error and cant't run the project. No problems while building. *Migrated to .net10/abp10


4 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent

    1. Solution

    The exception comes from AspNetCore.Diagnostics.HealthChecks UI using an EF Core version that doesn’t match your application’s EF Core (used by ABP 10).

    HealthChecks.UI v9.x targets a newer EF Core (where AbstractionsStrings.ArgumentIsEmpty exists).
    Your ABP 10.0.2 solution runs on EF Core 8, where that method does not exist, so you get:

    System.MissingMethodException: Method not found: 'System.String Microsoft.EntityFrameworkCore.Diagnostics.AbstractionsStrings.ArgumentIsEmpty(System.Object)'

    Concretely, the error is thrown when AddInMemoryStorage() configures UseInMemoryDatabase.

    Fix it by aligning the HealthChecks.UI packages to the EF Core version used by ABP:

    1. Find the HealthChecks packages in your solution (usually in your Web/Host project):

      Look in your .csproj for lines like:

    <PackageReference Include="AspNetCore.HealthChecks.UI" Version="9.0.0" />
       <PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="9.0.0" />
       <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.0-preview.*" />
    
    1. Downgrade them to the EF Core 8–compatible versions (match EF Core 8 used by ABP 10):

      Example:

    <ItemGroup>
         <!-- HealthChecks UI packages compatible with EF Core 8 -->
         <PackageReference Include="AspNetCore.HealthChecks.UI" Version="8.0.1" />
         <PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="8.0.1" />
    
         <!-- Make sure ALL EF Core packages are 8.x and consistent -->
         <PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
         <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
         <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0" />
       </ItemGroup>
    

    Adjust the exact version numbers to what your solution uses (8.0.*), but everything must be on 8.x, not 9.x/preview.

    1. Remove any stray EF Core 9/preview references:

      Search all projects for Microsoft.EntityFrameworkCore references and ensure there is no 9.x or preview package left (especially InMemory).

    2. Clean & rebuild:

      • Delete bin and obj folders of affected projects.
      • Run a full restore/build.
      • Run the application again; the health check UI should start without the MissingMethodException.
    3. (Optional) Use SQL storage instead of in-memory if you prefer:

      In your health check registration (typically in the Web/Host module), instead of:

    services
           .AddHealthChecksUI()
           .AddInMemoryStorage();
    

    you can use (for example):

    services
           .AddHealthChecksUI()
           .AddSqlServerStorage(configuration.GetConnectionString("Default"));
    

    Just be sure the storage provider package version also matches EF Core 8.

    Once all HealthChecks.UI and EF Core packages are aligned on 8.x, the AbstractionsStrings.ArgumentIsEmpty MissingMethodException will disappear and your project will run.

    2. Sources

    • HealthChecks UI project (versioning & EF Core dependencies):
      https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks
    • ABP main documentation entry point (for EF Core/ABP 10 alignment and health check integration):
      https://abp.io/docs/latest

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    hi

    Try to replace your packages as follows:

    <ItemGroup>
        <PackageReference Include="AspNetCore.HealthChecks.UI" Version="9.0.0" />
        <PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
        <PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="9.0.0" />
        <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.0" />
        
        <PackageReference Include="KubernetesClient" Version="18.0.5"/>
        <PackageReference Include="IdentityModel" Version="7.0.0" />
    </ItemGroup>
    
  • User Avatar
    0
    muglabb created

    It's ok, thank you

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    : )

Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.2.0-preview. Updated on January 09, 2026, 07:22
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.