Skip to content

[DRAFT - CI validation only] Fix WixToolset.Sdk resolution under CFSClean feed pinning - #1948

Closed
v-sohmondal wants to merge 7 commits into
mainfrom
users/v-sohmondal/es424-cfs-validation
Closed

v-sohmondal wants to merge 7 commits into
mainfrom
users/v-sohmondal/es424-cfs-validation

Conversation

@v-sohmondal

Copy link
Copy Markdown
Contributor

Draft / CI validation only — do not merge.
Throwaway branch to exercise the pipeline. The real change is #1947; this exists so that PR is not polluted with test commits.

Purpose

#1947 pins all restores to the private Azure Artifacts feed for SFI-ES4.2.4 (CFSClean). Every job in it currently fails:

MSI.wixproj(2,3): error : Could not resolve SDK "WixToolset.Sdk".
  Unable to find package WixToolset.Sdk. No packages exist with this id in source(s): a11y-insights-public
  warning : Unable to load the service index for source https://pkgs.dev.azure.com/.../a11y-insights-public/...
MSI.wixproj(2,31): error MSB4236: The SDK 'WixToolset.Sdk/4.0.1' specified could not be found.

Root cause

src/MSI/MSI.wixproj imports WixToolset.Sdk as an MSBuild project SDK. MSBuild resolves project SDKs at evaluation time via the NuGet SDK resolver, which is a different code path from package restore: it does not use the Azure Artifacts credential provider and ignores nugetConfigPath (NuGet/Home#7855, NuGet/Home#10178).

So it can reach neither the private feed (401) nor nuget.org (blocked by CFSClean). It is the only NuGet-delivered MSBuild SDK in the repo — the other 29 projects use the in-box Microsoft.NET.Sdk*, which resolve from disk.

Notably this is not a permissions issue: Project Collection Build Service already has Collaborator on the feed, NuGetAuthenticate@1 succeeds, and WixToolset.Sdk 4.0.1 is cached there.

Change

build/prepare-nuget.yml — a shared step template that authenticates, then downloads the SDK into the NuGet global packages folder before anything evaluates the solution, so resolution succeeds offline. The version is read from MSI.wixproj so the two cannot drift. It also replaces the NuGetAuthenticate@1 step duplicated across six call sites.

Plus two correctness fixes:

  • check-dependencies.yml — networkIsolationPolicy moved from pool: to templateContext.settings
  • signedbuild.yml — feedsToUse/nugetConfigPath un-nested from the projects: | block scalar in all three DotNetCoreCLI@2 restores, where they were being parsed as project globs

Verified locally

  • Script extracted from the YAML, macros expanded, executed verbatim → SDK downloaded
  • Real MSI.wixproj resolves its SDK against a completely unreachable feed
  • Control: empty packages folder + unreachable feed reproduces the exact MSB4236 failure

What this PR is meant to prove

  1. Nested template resolution (- template: prepare-nuget.yml) works in ADO
  2. The seed step runs correctly on the hosted agent
  3. The full restore/build/test completes with the feed pinned
  4. Stop Network Isolation reports CFSClean COMPLIANT

v-jitendjain and others added 6 commits August 7, 2026 16:41
MSBuild resolves MSI.wixproj's WixToolset.Sdk at evaluation time through the
NuGet SDK resolver, which does not use the Azure Artifacts credential provider
and ignores nugetConfigPath (NuGet/Home#7855, NuGet/Home#10178). Once restores
were pinned to the private feed in src/nuget.config it could authenticate to
neither that feed nor nuget.org (blocked by CFSClean), so every job failed with
MSB4236 "The SDK WixToolset.Sdk/4.0.1 specified could not be found".

Add build/prepare-nuget.yml, a shared step template that authenticates and then
downloads the SDK into the NuGet global packages folder before anything
evaluates the solution, so SDK resolution succeeds offline. The version is read
from MSI.wixproj so the two cannot drift. The template also replaces the
NuGetAuthenticate steps that were duplicated across six call sites.

Also:
- check-dependencies.yml: move networkIsolationPolicy from pool: to
  templateContext.settings
- signedbuild.yml: un-nest feedsToUse/nugetConfigPath from the projects: block
  scalar in all three DotNetCoreCLI@2 restores, where they were being treated
  as project globs rather than task inputs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0add1f23-4df3-4efa-8237-fe45d7d5e747
@v-sohmondal

Copy link
Copy Markdown
Contributor Author

/azp run

The Accessibility Insights build service was missing ReadPackages on the
a11y-insights-public feed, which surfaced as a 403 and, in the SDK resolver,
as "Unable to load the service index" - the same symptom the seed step was
built to work around. Now that the permission is granted, remove the seed to
determine whether the NuGet SDK resolver can authenticate on its own.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0add1f23-4df3-4efa-8237-fe45d7d5e747
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@v-sohmondal

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@v-sohmondal

Copy link
Copy Markdown
Contributor Author

Validation complete: the failure was a missing ReadPackages grant for the Accessibility Insights build service on the a11y-insights-public feed, not an SDK resolver limitation - with the permission granted, build 63775 on #1947 restores cleanly and reports CFSClean COMPLIANT with no seeding workaround, so closing this throwaway branch.

@v-sohmondal
v-sohmondal deleted the users/v-sohmondal/es424-cfs-validation branch August 10, 2026 07:10
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