Fix release archives: remove NetPace.Core.xml from publish output#197
Conversation
AllowedReferenceRelatedFileExtensions (previous attempt) filters reference- related files at the ResolveAssemblyReferences (build) step; it does not reliably filter ResolvedFileToPublish, the item group that drives what ends up in the publish directory. The root cause: GenerateDocumentationFile=true in NetPace.Core.csproj causes MSBuild to copy NetPace.Core.xml into every publish directory. PublishSingleFile bundles DLLs but explicitly excludes XML files, so the XML lands loose and breaks the "exactly 1 entry" archive contract across all 12 non-AOT variants. Fix: add a ComputeFilesToPublish AfterTargets hook in NetPace.Console.csproj that removes .xml entries from ResolvedFileToPublish. This targets the correct stage of the publish pipeline and covers both PublishSingleFile and AOT builds. NuGet pack is unaffected — packing uses _PackageFiles, not ResolvedFileToPublish. Co-authored-by: Frank Ray <FrankRay78@users.noreply.github.com>
Code ReviewOverviewThis PR adds an MSBuild The core fix is correct and well-targeted. One issue needs resolving before merge. Bug:
|
Fixes the failed
release-binariesworkflow on tags 0.23.0 and 0.23.1.Root Cause
NetPace.Core.csprojhasGenerateDocumentationFile=true(needed for NuGet IntelliSense). WhenNetPace.Consolepublishes, MSBuild copiesNetPace.Core.xmlinto the publish directory.PublishSingleFile=truebundles DLLs but explicitly excludes XML files, so the XML lands loose and breaks the "exactly 1 entry" archive contract across all non-AOT variants.The previous attempt (
AllowedReferenceRelatedFileExtensions) was never merged and was also the wrong fix: it filters at theResolveAssemblyReferences(build) stage, not theComputeFilesToPublish(publish) stage.Fix
Adds an MSBuild
AfterTargets="ComputeFilesToPublish"target inNetPace.Console.csprojthat removes.xmlentries fromResolvedFileToPublish. This covers all 16 matrix variants (PublishSingleFile and AOT).dotnet packforNetPace.Coreis unaffected — packing uses_PackageFiles, notResolvedFileToPublish.Related to PR #193.
Generated with Claude Code