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

Aspire.Hosting.SqlServer has dependency issues in 9.1 with TFM splitting #7779

Open
1 task done
aaronpowell opened this issue Feb 25, 2025 · 0 comments
Open
1 task done
Labels
area-integrations Issues pertaining to Aspire Integrations packages
Milestone

Comments

@aaronpowell
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When upgrading the Community Toolkit (which targets net8.0 and net9.0) we hit a problem with the Aspire.Hosting.SqlServer package and some transient dependencies:

dotnet restore                                                                                                                                                                                                                                                                                             
    D:\Aspire-CommunityToolkit\src\CommunityToolkit.Aspire.Hosting.SqlServer.Extensions\CommunityToolkit.Aspire.Hosting.SqlServer.Extensions.csproj : error NU1605:
      Warning As Error: Detected package downgrade: Microsoft.Extensions.Logging.Abstractions from 9.0.0 to 8.0.3. Reference the package directly from the project to select a different version. 
       CommunityToolkit.Aspire.Hosting.SqlServer.Extensions -> Aspire.Hosting.SqlServer 9.1.0 -> Microsoft.Data.SqlClient 6.0.1 -> Microsoft.Extensions.Caching.Memory 9.0.0 -> Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
       CommunityToolkit.Aspire.Hosting.SqlServer.Extensions -> Aspire.Hosting.SqlServer 9.1.0 -> Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
    D:\Aspire-CommunityToolkit\src\CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects\CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects.csproj : error NU1605:
      Warning As Error: Detected package downgrade: Microsoft.Extensions.Logging.Abstractions from 9.0.0 to 8.0.3. Reference the package directly from the project to select a different version.
       CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects -> Aspire.Hosting.SqlServer 9.1.0 -> Microsoft.Data.SqlClient 6.0.1 -> Microsoft.Extensions.Caching.Memory 9.0.0 -> Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
       CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects -> Aspire.Hosting.SqlServer 9.1.0 -> Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)

This shows up in VS like so:

Image

The problem seems to be due to the TFM splitting from the Microsoft.Data.SqlClient package and the upgrade to that in 9.1, but the hosting package isn't doing multiple TFM itself.

Expected Behavior

In-place upgrade should not result in large dependency failures like this.

Steps To Reproduce

  1. Create a new Aspire 9.1 project
  2. Add Aspire.Hosting.SqlServer to the app host
  3. Configure multi-targetting TFM

It can be see on our CI too - /~https://github.com/CommunityToolkit/Aspire/actions/runs/13532723492/job/37818388929?pr=475

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

You should be able to work around it by manually upgrading the dependency of Microsoft.Extensions.Logging.Abstractions to 9.0.2 when building for .NET 9.0.

aaronpowell added a commit to CommunityToolkit/Aspire that referenced this issue Feb 25, 2025
aaronpowell added a commit to CommunityToolkit/Aspire that referenced this issue Feb 26, 2025
* Preparing the 9.2 release by testing Aspire 9.1

- Updated to the 9.1 preview packages
- Removed the old VolumeNameGenerator since it's not provided by Aspire.Hosting (Fixes #354)

* Moving to 9.1.0 release of Aspire and deleting references that aren't needed

* Removing ArgumentEvaluator and using native method instead

* Adding missing launchSettings.json that VS really wants

* Disabling the nightly feed

* Removing VolumeNameGenerator now it's in the Aspire.Hosting package

* Some version fixes

* Dropping the Dapr.AzureRedis package from release due to publishing bugs

* I can spellz goodz

* Working around dotnet/aspire#7779

* Fixing some failing tests

* Fixing the dependency handling

In 9.1 this was causing a circular dependency chain, so the SqlProjectResource doesn't need to wait until the SQL database is ready, since that's the call site anyway

* Disabling test

* Setting release version
@eerhardt eerhardt added the area-integrations Issues pertaining to Aspire Integrations packages label Feb 26, 2025
@eerhardt eerhardt added this to the 9.2 milestone Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-integrations Issues pertaining to Aspire Integrations packages
Projects
None yet
Development

No branches or pull requests

2 participants