Fix NU5026: exclude PDB files from CopyProjectReferencesToPackage in TemplateLocator and Containers#54494
Fix NU5026: exclude PDB files from CopyProjectReferencesToPackage in TemplateLocator and Containers#54494Copilot wants to merge 2 commits into
Conversation
…cator Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
|
@copilot main CI is failing with a few other errors I can see: |
…ld.Containers Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Applied the same Root cause for both failures: Arcade SDK's The |
Main CI failing on macOS and Windows with
NU5026becauseCopyProjectReferencesToPackagewas adding.pdbfiles fromReferenceCopyLocalPathsintoBuildOutputInPackage, but those PDBs don't exist on disk when pack runs in official builds.Root cause: Arcade SDK's
Workarounds.targetsadds.pdbtoAllowedOutputExtensionsInPackageBuildOutputFolderwhenDebugType=portable(set globally by Arcade whenOfficialBuildIdis set), allowing PDB files to be included in packages. BothTemplateLocatorandMicrosoft.NET.Build.ContainersuseCopyProjectReferencesToPackagetargets that add allReferenceCopyLocalPaths— DLLs and PDBs alike — toBuildOutputInPackage. In official distributed builds, only DLLs are transferred between build agents, so PDB files don't exist on disk when pack runs, causing NU5026. Non-official builds useDebugType=embedded(no separate.pdb), so the issue never surfaces locally.Fix: In both projects, stage the copy-local paths into an intermediate item and exclude
.pdbextensions before adding toBuildOutputInPackage.Microsoft.DotNet.TemplateLocator(macOSNativeWrapper.pdbfailure):Microsoft.NET.Build.Containers(WindowsCli.Utils.pdbfailure):PDB files belong in their own symbol packages, not bundled inside the NuGet packages.