Skip to content

Conversation

@v-dmerugu
Copy link
Contributor

@v-dmerugu v-dmerugu commented Dec 23, 2025

Description

NuGet Package Source Mapping enforces that a package's declared source in must match a corresponding source name under .
The Azure Pipelines internal NuGet helper (NuGetConfigHelper2.ts) currently prefixes internal feed names with feed- when writing the temporary NuGet.config used during restore,
However, the helper does not update the section accordingly, leaving the mapping with the original key:

NuGet interprets this mismatch as a violation of Package Source Mapping rules and fails with:

NU1100: PackageSourceMapping is enabled, the following source(s) were not considered: feed-canarytest

📌 Bug 2340656: DotNetCoreCLI@2 breaks package source mappings for internal feeds when using a nuget.config file

Keeps existing feed prefixing untouched (feed- logic stays exactly as before).
Tracks original → prefixed feed names when internal sources are rewritten.
After the temp NuGet.config is generated, the fix:
Loads the XML,
Locates ,
Updates mapping keys to match their prefixed feed names, e.g.: canarytest → feed-canarytest
Writes back the corrected temporary config.


Package Name

packaging-common


Risk Assessment (Low / Medium / High)

Low - Only modifies temporary NuGet.config used during restore and doesnot modify prefixing logic or authentication logic.


Unit Tests Added or Updated

  • Unit tests added or updated
  • Manual tests performed

Additional Testing Performed

Tested Manually by uploading changes to private org - https://dev.azure.com/v-dmerugu0683/Sample%20Project/_build/results?buildId=1023&view=logs&j=4ef10708-f316-5e1d-20e0-afbca60c92cd&t=77245893-7256-55ca-6acf-ef97785d1a31
image


Documentation Changes Required (Yes / No)

yes - https://learn.microsoft.com/en-us/nuget/consume-packages/package-source-mapping


Related Issues

microsoft/azure-pipelines-tasks#21507

Checklist


@v-dmerugu
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants