AspNetCore.Diagnostics.HealthChecks icon indicating copy to clipboard operation
AspNetCore.Diagnostics.HealthChecks copied to clipboard

Could not load file or assembly Microsoft.Bcl.AsyncInterfaces .NET 8

Open nschoenberg opened this issue 1 year ago • 3 comments

What happened:

Recently upgraded my web app to .NET 8, queue healthchecks where working fine before upgrading. Other healthchecks like postgre sql database are still working fine. Im getting the following error in Azure:

Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

What you expected to happen:

No exception, healthcheck runs as expected

How to reproduce it (as minimally and precisely as possible):

Add a healthcheck to a service bus

Source code sample:

var connectionString = "sb endpoint here";
.AddAzureServiceBusQueueMessageCountThreshold(connectionString , "YourQueueNameHere",
                                                              "Message Count", conf =>
                                                              {
                                                                  conf.ActiveMessages = new AzureServiceBusQueueMessagesCountThreshold
                                                                  {
                                                                      DegradedThreshold = 20000,
                                                                      UnhealthyThreshold = 100000
                                                                  };
                                                              });

Anything else we need to know?:

Environment:

  • .NET Core version: .NET 8
  • Healthchecks version
  • Operative system: Windows x64
  • Others:

nschoenberg avatar Feb 12 '24 07:02 nschoenberg

We encountered this as well, for the moment we reverted to AspNetCore.HealthChecks.AzureServiceBus 7.0.0 as it seems to work

ben-002 avatar Feb 14 '24 15:02 ben-002

We are seeing the same thing for AspNetCore.HealthChecks.Azure.Storage.Blobs.

"StorageConnectionString":{"data":{},"description":"Could not load file or assembly \u0027Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51\u0027. The system cannot find the file specified."

  • Edit I fixed this by explicitly installing the Microsoft.Bcl.AsyncInterfaces 8.0.0 package.

throwaway34059 avatar Feb 15 '24 17:02 throwaway34059

@sungam3r This seems to be a duplicate of #2084.

hschink avatar Feb 20 '24 20:02 hschink