Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After update package 7.0.0 on asp.net core 6.0 Im geting error #1975

Open
phivanloi opened this issue Aug 1, 2023 · 17 comments
Open

After update package 7.0.0 on asp.net core 6.0 Im geting error #1975

phivanloi opened this issue Aug 1, 2023 · 17 comments
Labels
bug Something isn't working dependencies Pull requests that update a dependency file

Comments

@phivanloi
Copy link

After update package 7.0.0 on asp.net core 6.0 Im geting error
image

@cieciurm
Copy link
Contributor

cieciurm commented Aug 1, 2023

Hi,

I've experienced it as well.

Try installing Microsoft.Bcl.AsyncInterfaces in version 7.0.0.

@sungam3r
Copy link
Collaborator

sungam3r commented Aug 1, 2023

See #1720 . This PR explains the problem. @phivanloi What packages exactly do you use? We can add reference to Microsoft.Bcl.AsyncInterfaces as we already did in #1720.

@sungam3r sungam3r added the dependencies Pull requests that update a dependency file label Aug 1, 2023
@phivanloi
Copy link
Author

phivanloi commented Aug 1, 2023

Thanks cieciurm And sungam3r. I'm add line code

<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />

to fix this error.

@corentinaltepe
Copy link

Hi, I also had the same issue and also fixed it by adding Microsoft.Bcl.AsyncInterfaces to all projects using healthchecks.

However, this is more of a workaround than a fix, isn't it? Shouldn't AspNetCore.Diagnostics.HealthChecks bring it as a dependency if it needs it? Otherwise, the Readme should specify clearly that this dependency must be added alongside AspNetCore.Diagnostics.HealthChecks.

@sungam3r
Copy link
Collaborator

sungam3r commented Aug 2, 2023

However, this is more of a workaround than a fix, isn't it?

It's hard to tell.

Shouldn't AspNetCore.Diagnostics.HealthChecks bring it as a dependency if it needs it?

Please read #1692 (comment) . It looks like an issue on MS side. HealthChecks' packages are just intermediate victim. I'm open to suggestions and best practices.

@corentinaltepe Please look into deps file in your output folder and search exact package that depends on Microsoft.Bcl.AsyncInterfaces.

@corentinaltepe
Copy link

Hi @sungam3r.

Is this what you were looking for?
image

@IGx89
Copy link

IGx89 commented Aug 2, 2023

Also ran into this on our .NET 6 app. Caused by the dependency on Microsoft.Extensions.Diagnostics.HealthChecks v7, which brings in other .NET 7 deps. We've avoided using .NET 7 packages in our .NET 6 apps due to that not feeling right (does every .NET 7 package guarantee backwards compatibility with ASP.NET Core 6? Seems unlikely). Unless you add a TFM for .NET 6 that targets Microsoft.Extensions.Diagnostics.HealthChecks v6, looks like we'll be waiting to upgrade from v6 until we go to .NET 8.

@cmeeren
Copy link

cmeeren commented Aug 9, 2023

This happens even in .NET 7 with AspNetCore.HealthChecks.AzureStorage.

@cieciurm
Copy link
Contributor

cieciurm commented Aug 9, 2023

To be honest, I'm not sure if it's related to the AspNetCore.HealthChecks packages.

I've experienced it in a project which didn't use Health Checks.

The setup was:

  • Web project target .net 6
  • Some other project targeting .net standard 2.0 with dependency to Azure.Storage.Blobs
  • Web projects is referencing the other project

On running the web project the described errors occurs.

@cmeeren

This comment was marked as outdated.

@cmeeren

This comment was marked as outdated.

@OldWiseLlama
Copy link

OldWiseLlama commented Sep 12, 2023

When installing the version 7.0.0 packages of AspNetCore.HealthChecks.AzureServiceBus or AspNetCore.HealthChecks.AzureStorage to .net 7 projects it seems that the DLLs target .netstandard 2.0. The version 6 packages targeted .NETCoreApp, Version=v6.0 when installing to .net 6 project. Seems like a version mismatch in the libraries. .NET 7 shouldn't need to reference the Microsoft.Bcl.AsyncInterfaces library.

EDIT: OK so this is a targeting issue. You'll want to multi target these libraries and add .net 7 target for version 7 packages.

@OlegUfaev
Copy link

OlegUfaev commented Sep 19, 2023

We had the same problem in ASP.NET Core application in .NET 6 project, when upgrading the AspNetCore.HealthChecks.Oracle nuget package from version 6.x to version 7.x

Currently, the AspNetCore.HealthChecks.Oracle package version 7.x now has a dependency on Microsoft.Extensions.Diagnostics.HealthChecks (>= 7.0.9)

Meanwhile, the AspNetCore.HealthChecks.Oracle package in version 6.x had this dependency: Microsoft.Extensions.Diagnostics.HealthChecks (>= 6.0.3)

In fact, all nuget packages of Microsoft.Extension.* version 7.x run in .NET 6 just fine, without any problems (they all have a target on net6.0). So maybe it was not worth changing the minimum version in the dependency to Microsoft.Extensions.Diagnostics.HealthChecks.

Please consider changing the dependency from Microsoft.Extensions.Diagnostics.HealthChecks (>= 7.0.9) to Microsoft.Extensions.Diagnostics.HealthChecks (>= 6.0.3), or having separate targets for net6.0 and net7.0.

@sungam3r
Copy link
Collaborator

sungam3r commented Dec 3, 2023

Please consider changing the dependency from Microsoft.Extensions.Diagnostics.HealthChecks (>= 7.0.9) to Microsoft.Extensions.Diagnostics.HealthChecks (>= 6.0.3), or having separate targets for net6.0 and net7.0.

Well... Of course it's possible but I think it goes against current targeting design when v X.* versions of packages are targeted at v X.* version of NET.

ping @unaizorrilla @adamsitnik

@adamsitnik
Copy link
Collaborator

Well... Of course it's possible but I think it goes against current targeting design when v X.* versions of packages are targeted at v X.* version of NET.

If you are using .NET X you should be using X.* version of our packages.

@sungam3r
Copy link
Collaborator

sungam3r commented Feb 2, 2024

Guys, what do you think about #1980 (comment) ?

@sungam3r sungam3r added the bug Something isn't working label Feb 2, 2024
@TomasMalecek
Copy link

TomasMalecek commented Jul 12, 2024

I believe this is Microsoft's fault. They should either remove the unsupported TFMs from their packages and document the support policy, or fix the issue.

I added a comment under what I believe to be the upstream issue to this one: dotnet/aspnetcore#45278 (comment)

But in .NET 8, the issue seems to be resolved, somehow: dotnet/aspnetcore#45278 (comment)

If this is not the case, though, releasing a workaround as part of AspNetCore.Diagnostics.HealthChecks before the upstream issue is fixed may still have value. The clients should not be forced to install Microsoft.Bcl.AsyncInterfaces in the correct version themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants