Repository navigation
make-release: accept comma-joined -Rid from -File callers (fixes the release job's MSB1006) - #3
Merged
Conversation
The CI passes the RID list as 'pwsh -File ... -Rid win-x64,linux-x64'.
With -File, PowerShell binds that comma-joined string to the [string[]]
parameter as a single element, so the per-RID loop ran once with the
joined value and dotnet publish handed MSBuild '-r
win-x64,linux-x64' in one piece -- MSBuild read the second RID as a
bare switch and failed with MSB1006 ('Switch: linux-x64').
Normalize the parameter at the top of the script: split every element
on commas and trim. Array callers (the documented default) are
unaffected; -File callers now get one publish per RID as the loop
intends.
…nner (the previous run's failure is a file-lock, not a code change)
StArraySharp
approved these changes
Nov 4, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The failure
release artifacts / Packagefailed on main (run 41218035128) with:Why
The CI invokes the script with
pwsh -File tools/make-release.ps1 -Rid win-x64,linux-x64. In-Filemode PowerShell binds that comma-joined string to the[string[]]parameter as a single element (no array splitting), so the per-RIDforeachran once withwin-x64,linux-x64and handeddotnet publish -r win-x64,linux-x64to MSBuild in one piece -- MSBuild then read the second RID as a bare switch (MSB1006).The fix
Normalize the parameter at the top of the script: split every element on commas and trim, so both caller forms reach the loop as one RID per element:
-Rid win-x64,linux-x64(the CI's-Fileform) →win-x64,linux-x64-Rid @('win-x64','linux-x64')(the documented default/array form) → unchangedBoth forms verified locally (count and content of the resulting list).
Verification note
The
release artifactsjob only runs on pushes tomainand tags, so this branch's CI exercisesbuild + testonly -- the packaging path gets its proof when this lands on main and the next release job runs green.