You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SQLProjects] NuGet restore loop with centrally managed packages #1065
When updating the CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects package in a Directory.Packages.props file, Visual Studio gets in a nuget restore loop.
A minimal reproduction has been created, which can be found here: AspireNuGetLoop.zip
Regression
9.9.0 with .NET 9
Steps to reproduce
1. Open the provided solution
2. See the nuget restore loop happen.
3. Move from centrally managed packages to defining them in the CSPROJ directly.
4. Notice that the restore and build succeed.
Expected behavior
Works the same as when not using a Directory.Packages.props file.
@codijk I'm running into the same problem, same version of Visual Studio, and I get build errors complaining about the version of Microsoft.Build, which seems to be pulled in from that same file you indicated. VS 2026 seems to want version 18, and this library is forcing version 17.
I don't have a fix yet other than removing the reference which isn't great.
@ErikEJ Apologies, I should have explained it a bit better.
I get the exact same NuGet restore loop error. I just get an extra error talking about the Microsoft.Build package, and those three packages @codijk mentioned (Microsoft.Build, Microsoft.Build.Framework, Microsoft.NET.StringTools) happen to be the packages which get stuck in the loop of restored, removed, restored again. I can see it flicking in and out in Visual Studio, and after it does that a few times I ultimately get the NuGet loop error. That's why I'm thinking it's the same problem, but if they really are different then I'm happy to open a separate issue. Thanks!
I also have exactly the same problem with Aspire projects and this package as described above by @codijk and @SamuelMcAravey using central package management. My VS gets stuck into a loop trying to restore the packages which fails on this project's package and then I get this error.
It is very blocking for upgrading to .NET 10, I have not been able to find a workaround for this. Trying different package versions together or pinning versions in our own project has not resolved this.
I don't think there's anything we can do in the toolkit to resolve it. My assumption is that it's related to the hack from #949 (comment) that is because the DacFx package is not doing the right thing with the MS Build libraries.
I'm not sure what to do about it short of trying to find the owners internally at MS
We have noticed this issue has not been updated within 21 days. If there is no action on this issue in the next 14 days, we will automatically close it. You can use /stale-extend to extend the window.
We have noticed this issue has not been updated within 21 days. If there is no action on this issue in the next 14 days, we will automatically close it. You can use /stale-extend to extend the window.
Setting "IsImplicitlyDefined"="true" in the props file would fix this issue. I see that custom SDKs do this and those work with CPM.
I tried changing the props in my nuget cache and after that I was able to build. It's not a well documented feature.
We have noticed this issue has not been updated within 21 days. If there is no action on this issue in the next 14 days, we will automatically close it. You can use /stale-extend to extend the window.
Activity
codijk commentedon Dec 15, 2025
I think it goes wrong in this file.
SamuelMcAravey commentedon Dec 15, 2025
@codijk I'm running into the same problem, same version of Visual Studio, and I get build errors complaining about the version of Microsoft.Build, which seems to be pulled in from that same file you indicated. VS 2026 seems to want version 18, and this library is forcing version 17.
I don't have a fix yet other than removing the reference which isn't great.
ErikEJ commentedon Dec 15, 2025
@SamuelMcAravey That does not sound like the same issue. What makes you think it is?
If not, please create a new one.
SamuelMcAravey commentedon Dec 15, 2025
@ErikEJ Apologies, I should have explained it a bit better.
I get the exact same NuGet restore loop error. I just get an extra error talking about the Microsoft.Build package, and those three packages @codijk mentioned (
Microsoft.Build,Microsoft.Build.Framework,Microsoft.NET.StringTools) happen to be the packages which get stuck in the loop of restored, removed, restored again. I can see it flicking in and out in Visual Studio, and after it does that a few times I ultimately get the NuGet loop error. That's why I'm thinking it's the same problem, but if they really are different then I'm happy to open a separate issue. Thanks!ErikEJ commentedon Dec 15, 2025
@SamuelMcAravey Thanks for the additional explanation
codijk commentedon Dec 15, 2025
@SamuelMcAravey that is exactly what I am seeing as well. Those 3 packages keep being added and removed until the NuGet restore loop error appears.
pheeblyboos commentedon Dec 16, 2025
I also have exactly the same problem with Aspire projects and this package as described above by @codijk and @SamuelMcAravey using central package management. My VS gets stuck into a loop trying to restore the packages which fails on this project's package and then I get this error.
It is very blocking for upgrading to .NET 10, I have not been able to find a workaround for this. Trying different package versions together or pinning versions in our own project has not resolved this.
ErikEJ commentedon Jan 5, 2026
@pheeblyboos
Workaround:
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>@aaronpowell Any ideas how to fix this?
aaronpowell commentedon Jan 12, 2026
I don't think there's anything we can do in the toolkit to resolve it. My assumption is that it's related to the hack from #949 (comment) that is because the DacFx package is not doing the right thing with the MS Build libraries.
I'm not sure what to do about it short of trying to find the owners internally at MS
ErikEJ commentedon Jan 12, 2026
@aaronpowell You mean the owners of the DacFX package?
ErikEJ commentedon Jan 12, 2026
@dzsquared It sounds like @aaronpowell has soem ideas how you can fix this in the DacFX package
aaronpowell commentedon Jan 12, 2026
Oh, I haven't an idea on how to fix it, just that that package is causing the MS Build assembly to be in the output folder which it shouldn't do
ErikEJ commentedon Jan 12, 2026
@aaronpowell I misunderstood your comment here then: #949 (comment)
Odonno commentedon Jan 14, 2026
Adding a
Microsoft.Buildreference to the SQL project seems to do the trick.ErikEJ commentedon Jan 14, 2026
@Odonno What does that reference look like?
3 remaining items
github-actions commentedon Mar 31, 2026
We have noticed this issue has not been updated within 21 days. If there is no action on this issue in the next 14 days, we will automatically close it. You can use
/stale-extendto extend the window.ErikEJ commentedon Mar 31, 2026
/stale-extend
github-actions commentedon Apr 23, 2026
We have noticed this issue has not been updated within 21 days. If there is no action on this issue in the next 14 days, we will automatically close it. You can use
/stale-extendto extend the window.almostchristian commentedon Apr 23, 2026
Setting
"IsImplicitlyDefined"="true"in the props file would fix this issue. I see that custom SDKs do this and those work with CPM.I tried changing the props in my nuget cache and after that I was able to build. It's not a well documented feature.
ErikEJ commentedon Apr 23, 2026
@almostchristian just setting that and no other changes?
ErikEJ commentedon Apr 23, 2026
/stale-extend
almostchristian commentedon Apr 23, 2026
yes, I just appended that to the props file, and I'm able to build
github-actions commentedon May 15, 2026
We have noticed this issue has not been updated within 21 days. If there is no action on this issue in the next 14 days, we will automatically close it. You can use
/stale-extendto extend the window.ErikEJ commentedon May 15, 2026
/stale-extend