BEST
DEALS
OF THE
YEAR!
SAVE UP TO $3,000
LAST DAY 1 DEC
00 Days
00 Hrs
00 Min
00 Sec
Open Closed

abp 10.0 FileNotFoundException: Could not load IdentityModel v5.2.0 in HealthCheck collector (affects both ApiHost and Web projects) #10144


User avatar
0
829098@qq.com created

Hello ABP Team,

I'm encountering a consistent runtime error in both the ApiHost and Web projects of my ABP-based solution (built using ABP Studio with the latest templates). The error occurs in the HealthChecks UI background service and prevents health report collection.

Exception Details:

System.IO.FileNotFoundException: Could not load file or assembly 'IdentityModel, Version=5.2.0.0, Culture=neutral, PublicKeyToken=e7877f4675df049f'. The system cannot find the file specified. at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReportAsync(HealthCheckConfiguration configuration) ... This error repeats every 10 seconds in the logs:

[ERR] HealthCheck collector HostedService threw an error: Could not load file or assembly 'IdentityModel, Version=5.2.0.0, ... Environment:

ABP Framework version: v10(as shown in footer of documentation) .NET version: .NET 10.0.0 Solution type: Microservice (with Gateway, Web, and ApiHost services) All ABP packages were updated via ABP Studio → Upgrade ABP Packages Steps to Reproduce:

Create a new microservice solution using ABP Studio (v10+). Run the *.Web and *.ApiHost projects. Observe the error in application logs shortly after startup. Observations:

The IdentityModel package (v5.2.0) appears to be a transitive dependency of AspNetCore.HealthChecks.UIClient or related health check components. However, it is not explicitly installed in the project, and no binding redirect or assembly resolution is configured. Manually adding <PackageReference Include="IdentityModel" Version="5.2.0" /> to the affected projects resolves the issue temporarily—but this should ideally be handled by the ABP template or dependency graph. Request: Please investigate whether the ABP microservice template (or HealthChecks integration) is missing an explicit dependency on IdentityModel, or if there’s a version mismatch between transitive dependencies in the current preview release.

Thank you for your support!

Best regards,


6 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    1. Solution
    • Root cause: HealthChecks.UI (Xabaril) internally uses IdentityModel for some scenarios (e.g., OAuth2 discovery, client credentials). In certain dependency graphs, IdentityModel isn’t copied to the output when it’s only a transitive dependency. Then the HealthChecks UI background collector fails with “Could not load file or assembly 'IdentityModel, Version=5.2.0.0'”.

    • Quick fix (per project failing at runtime, e.g., *.Web and *.ApiHost):

      1. Add an explicit package reference to IdentityModel 5.2.0 (the version your error requests):
    <ItemGroup>
        <PackageReference Include="IdentityModel" Version="5.2.0" />
      </ItemGroup>
    
    1. Clean and rebuild the solution.
    • Microservice template HealthChecks configuration check:
      • In your HealthChecksBuilderExtensions (or equivalent), ensure the UI is configured normally; nothing extra is required beyond adding the package when the assembly resolution problem occurs. Example pattern:
    services
          .AddHealthChecks()
          .AddCheck<MyProjectNameDatabaseCheck>("Database");
    
      services.AddHealthChecksUI(settings =>
      {
          settings.AddHealthCheckEndpoint("Self", "/health-status"); // or your configured URL
      })
      .AddInMemoryStorage();
    
    • If you are running containerized/k8s and want to use machine name, you may set:
    settings.AddHealthCheckEndpoint("Self", $"http://{System.Net.Dns.GetHostName()}/health-status");
    

    Otherwise keep using the configured healthCheckUrl string.

    • Why this is safe: The IdentityModel package is a pure client library (no side effects if unused at runtime) and matches the HealthChecks UI’s transitive expectation. Adding it explicitly pins the assembly and avoids loader failures.

    • Optional: Align HealthChecks packages

      • Ensure the Xabaril packages you use (AspNetCore.HealthChecks.UI, AspNetCore.HealthChecks.UI.Client, etc.) are on compatible versions across your services. If you see similar loader issues with other assemblies, update these packages consistently so their transitive dependencies match.
    1. Sources
    • ABP Microservice Health Check Configuration:
      • https://abp.io/docs/latest/solution-templates/microservice/health-check-configuration
      • https://abp.io/docs/10.0//solution-templates/microservice/health-check-configuration
    • Xabaril HealthChecks (HealthChecks.UI):
      • https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks
    • IdentityModel 5.2.0 package:
      • https://www.nuget.org/packages/IdentityModel/5.2.0
    • ABP Module System (general reference):
      • https://abp.io/docs/latest/framework/architecture/modularity/basics

    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
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can try to add <PackageReference Include="IdentityModel" Version="7.0.0" /> after KubernetesClient.

    We will update Studio templates in version 2.0.2

    Thanks.

  • User Avatar
    0
    829098@qq.com created

    这个可以。但是api站点会出现 Unable to render this definition The provided definition does not specify a valid version field.

    Please indicate a valid Swagger or OpenAPI version field. Supported version fields are swagger: "2.0" and those that match openapi: 3.x.y (for example, openapi: 3.1.0).

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    错误的的日志和截图是?

  • User Avatar
    0
    829098@qq.com created

    可能是服务器环境的问题,客户端访问正常。

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    好的

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on November 20, 2025, 09:12
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.