Visitar URL original
Fix CI: pass short framework name to dotnet add package on upgrade by slang25 · Pull Request #750 · dotnet-outdated/dotnet-outdated · GitHub
Skip to content

Fix CI: pass short framework name to dotnet add package on upgrade - #750

Merged
slang25 merged 1 commit into
masterfrom
slang25/fix-failing-ci
May 29, 2026
Merged

slang25 merged 1 commit into
masterfrom
slang25/fix-failing-ci

Conversation

@slang25

@slang25 slang25 commented May 29, 2026

Copy link
Copy Markdown
Member

The --upgrade path passed project.Framework.ToString() (the long-form moniker, e.g. .NETStandard,Version=v2.0) as the -f argument to dotnet add package, but newer .NET SDKs reject that form with "Package is incompatible with 'user specified' frameworks", causing every upgrade to fail. This broke the variable-preservation end-to-end tests on every PR in CI. The fix uses NuGetFramework.GetShortFolderName() (e.g. netstandard2.0), which is the form the -f flag expects. All 172 tests now pass locally (1 skipped).

🤖 Generated with Claude Code

…kage

The upgrade path passed project.Framework.ToString() (the long-form
moniker, e.g. ".NETStandard,Version=v2.0") as the -f argument to
`dotnet add package`. Newer .NET SDKs reject this form with "Package is
incompatible with 'user specified' frameworks", causing every upgrade to
fail and the variable-preservation end-to-end tests to break in CI.

Use NuGetFramework.GetShortFolderName() (e.g. "netstandard2.0") instead,
which is the form the -f flag expects.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@slang25
slang25 merged commit 6bf1be8 into master May 29, 2026
6 checks passed
@slang25
slang25 deleted the slang25/fix-failing-ci branch May 29, 2026 17:29
slang25 added a commit to GREsau/dotnet-outdated that referenced this pull request Nov 8, 2026
Resolves conflicts with variable tracking (dotnet-outdated#714), the CPM --no-restore
direct write (dotnet-outdated#713), file-based apps (dotnet-outdated#752/dotnet-outdated#755) and short TFM names (dotnet-outdated#750).
AddPackage now takes the VersionRange through all of master's new paths;
single-version paths use the range's lower bound for now (refined in
follow-up commits). Restores the System.Text.Json using needed by master's
tests and adapts DotNetPackageServiceTests to the new signature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant