Conversation
Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11624Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11624" |
Copilot
AI
changed the title
[WIP] In NuGetConfigMerger, when the PackageChannel has the ConfigureGlobalPackagesFolder to true we set the globalPackagesFolder config value in the nuget.config folder to .nuget\packages. however this causes a problem on Linux systems because it stops pack...
Fix globalPackagesFolder path to be platform-agnostic in NuGetConfigMerger
Sep 24, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a platform-specific issue where the NuGet global packages folder path was causing package restore failures on Linux systems due to Windows-specific backslash path separators.
- Changes the globalPackagesFolder value from
.nuget\packagesto.nugetpackagesto eliminate path separator issues - Updates the corresponding test to expect the new path value
- Ensures cross-platform compatibility while maintaining the same package isolation functionality
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Aspire.Cli/Packaging/NuGetConfigMerger.cs | Updated globalPackagesFolder value from .nuget\packages to .nugetpackages |
| tests/Aspire.Cli.Tests/Packaging/PackagingServiceTests.cs | Updated test assertions to expect the new .nugetpackages path value |
mitchdenny
approved these changes
Sep 24, 2025
davidfowl
approved these changes
Sep 24, 2025
Member
|
/backport to release/9.5 |
Contributor
|
Started backporting to release/9.5: https://github.com/dotnet/aspire/actions/runs/17966499657 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the PackageChannel has
ConfigureGlobalPackagesFolderset totrue, the NuGetConfigMerger sets theglobalPackagesFolderconfig value in the nuget.config to.nuget\packages. This causes package restore to fail on Linux systems because the backslash path separator is Windows-specific.Solution
Changed the
globalPackagesFoldervalue from.nuget\packagesto.nugetpackages(removed the slash entirely). This approach:Changes
AddGlobalPackagesFolderConfigurationmethod to use.nugetpackagesinstead of.nuget\\packagesTesting
The existing test
NuGetConfigMerger_WhenChannelRequiresGlobalPackagesFolder_AddsGlobalPackagesFolderConfigurationhas been updated and continues to pass, ensuring the XML structure is correct and the globalPackagesFolder value is properly set to.nugetpackages.This change only affects staging channels where
ConfigureGlobalPackagesFolderis enabled and resolves the Linux package restore issue without impacting other functionality.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.