Skip to content

[SQL Projects] 13.6.1 fails to build #2239

Open

Description

@ErikEJ

Describe the bug

Warning As Error: Detected package downgrade: Microsoft.NET.StringTools from 18.4.0 to 17.11.48. Reference the package directly from the project to select a different version.
DemoAppHost -> Aspire.Hosting.AppHost 13.6.1 -> StreamJsonRpc 2.25.29 -> Nerdbank.MessagePack 1.2.4 -> Microsoft.NET.StringTools (>= 18.4.0)
DemoAppHost -> Microsoft.NET.StringTools (>= 17.11.48)

Regression

13.3.0 was working

Steps to reproduce

<Project Sdk="Aspire.AppHost.Sdk/13.6.1">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects" Version="13.6.0" />
  </ItemGroup>

</Project>

Expected behavior

Build succeeds

Screenshots

No response

IDE and version

Other

IDE version

VS 2026

Nuget packages


Additional context

Most likely due to the target files forcing the 17.11 versions

Help us help you

Yes, but only if others can assist

Activity

  1. ErikEJ commented on Oct 9, 2026

    @ErikEJ
    ContributorAuthor
  2. jmezach commented on Oct 9, 2026

    @jmezach
    Contributor

    @ErikEJ Does this fail on dotnet restore or on dotnet build? I just created a test.csproj with the contents above and did a dotnet restore which works fine?

  3. ErikEJ commented on Oct 9, 2026

    @ErikEJ
    ContributorAuthor

    @jmezach I am building in Visual Studio 2026

  4. jmezach commented on Oct 9, 2026

    @jmezach
    Contributor

    @ErikEJ Ah, I'm on a Mac so don't have VS handy at the moment. Does just doing a restore work in VS? If that also fails, then the restore graph is somehow different in Visual Studio than it is with the .NET SDK?

  5. ErikEJ commented on Oct 9, 2026

    @ErikEJ
    ContributorAuthor

    @jmezach Looks like restore works, yes. But the SQL Projects does some magic to force the version of the MsBuild libraries.

  6. jmezach commented on Oct 9, 2026

    @jmezach
    Contributor

    @ErikEJ I guess those PackageReferences in the .props file need to be upgraded to match whatever Aspire is using currently (18.4 apparently for Microsoft.NET.StringTools). That will fix it for the time being, but I think we'll need a more robust solution here for the future.

    I know there is some work being done around how .NET projects are added to Aspire in the next major version. Haven't looked at it in detail yet, but I believe that should break the dependency on MSBuild so hopefully that will resolve these kinds of issues, but not sure.

  7. ErikEJ commented on Oct 9, 2026

    @ErikEJ
    ContributorAuthor

    @jmezach Removing the .props files fixed thing for me in VS 2026!

  8. ErikEJ commented on Oct 9, 2026

    @ErikEJ
    ContributorAuthor

    @aaronpowell @jmezach Happy to create a PR to remove them - thoughts?

  9. jmezach commented on Oct 9, 2026

    @jmezach
    Contributor

    @ErikEJ That file was added for a reason in #949 and subsequently updated in #1291, so I'm not sure if just removing it is the right approach? Then again, I don't know the exact reason it was added in the first place.

  10. ErikEJ commented on Oct 9, 2026

    @ErikEJ
    ContributorAuthor

    I don't know the exact reason it was added in the first place.

    Indeed, neither do I 😄

  11. afscrome commented on Oct 10, 2026

    @afscrome
    Contributor

    Yea, the V2 project resources (AddDotnetProject) only reference the project by path, not as an MSBuild reference, which may solve/avoid these issues.

    https://aspire.dev/whats-new/aspire-13-6/#-app-model-and-apphost

  12. ErikEJ commented on Oct 10, 2026

    @ErikEJ
    ContributorAuthor

    @afscrome ok, so what would a possible solution be?

  13. manuelelucchi commented on Oct 30, 2026

    @manuelelucchi
    Contributor

    I'm working on a PR to add support for non PackageReference/ProjectReference and therefore also supporting #1536

  14. ErikEJ commented on Oct 30, 2026

    @ErikEJ
    ContributorAuthor

    @manuelelucchi What are you missing? You can also use .dacpac files directly

  15. manuelelucchi commented on Oct 30, 2026

    @manuelelucchi
    Contributor

    Yeah but it's not the same as Project/Package support but without needing references (and therefore not being polyglot)

  16. ErikEJ commented on Nov 18, 2026

    @ErikEJ
    ContributorAuthor

    @jmezach I managed to get an Aspire 17 AppHost to build in Visual Studio 2026 with the following project file.

    Should probably update the docs to call out the new required properties for project references?

    Adding <PackageReference Include="Microsoft.NET.StringTools" Version="18.4.0" /> fixes the MsBuild targets workaound warning.

    Still believe it should be removed tbh.

    <Project Sdk="Microsoft.NET.Sdk">
    
      <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net10.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
        <UserSecretsId>09a9c2f6-60b3-4a3e-b552-f84da48cbefe</UserSecretsId>
      </PropertyGroup>
    
      <ItemGroup>
        <PackageReference Include="Aspire.Hosting.AppHost" Version="17.0.0" />
        <PackageReference Include="Aspire.Hosting.Dotnet" Version="17.0.0" />
        <PackageReference Include="System.Security.Cryptography.Pkcs" Version="10.0.15" />
        <PackageReference Include="Microsoft.NET.StringTools" Version="18.4.0" />
        <PackageReference Include="CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects" Version="17.0.0-beta.1052" />
      </ItemGroup>
    
      <ItemGroup>
        <ProjectReference IsAspireProjectResource="true" ReferenceOutputAssembly="false" Include="..\Database\Database.csproj" />
      </ItemGroup>
    
    </Project>
    
  17. jmezach commented on Nov 18, 2026

    @jmezach
    Contributor

    @ErikEJ I think we'll need to adopt the Dotnet hosting package integration approach here to resolve these kinds of issues. It looks like Aspire is moving away from referencing these projects directly and rather just pointing at their path. That makes sense given the now polyglot nature of Aspire of course, but does mean we'll have to do a lot of things ourselves now (as seen in #2425) that we previously got for free, like building the project, restoring NuGet packages, etc.

  18. ErikEJ commented on Nov 18, 2026

    @ErikEJ
    ContributorAuthor

    @jmezach Yeah, too bad. But we now have a pending PR with code to do that 😄

  19. jmezach commented on Nov 18, 2026

    @jmezach
    Contributor

    @ErikEJ Sure, but I'd still rather not re-invent the wheel. I'm wondering if we could actually build on top of the DotnetProjectResource from the Aspire .NET hosting integration and still get some of this for free

  20. ErikEJ commented on Nov 18, 2026

    @ErikEJ
    ContributorAuthor

    @jmezach Yeah, sounds sensible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions