Skip to content

Work around dotnet tool exec auth failure on private NuGet feeds#7347

Merged
macsux merged 1 commit intomainfrom
macsux/dotnet-tool-auth-fix
Apr 10, 2026
Merged

Work around dotnet tool exec auth failure on private NuGet feeds#7347
macsux merged 1 commit intomainfrom
macsux/dotnet-tool-auth-fix

Conversation

@macsux
Copy link
Copy Markdown
Contributor

@macsux macsux commented Apr 10, 2026

Summary

  • Replaces dotnet tool exec with dotnet tool install --tool-path + direct execution to work around dotnet/sdk#51375, where dotnet tool exec fails to authenticate against private NuGet feeds (401 Unauthorized)
  • dotnet tool install handles NuGet authentication correctly; the tool is installed to a persistent version-specific path (~/.dotnet/rewrite-tools/<version>/) so multiple versions can coexist without file-lock conflicts during parallel execution
  • Subsequent runs skip the install step entirely (checks if the executable already exists)

Test plan

  • Verified dotnet tool install --tool-path + direct execution works with empty cache (fresh install)
  • Verified subsequent runs skip install and run directly from cache
  • Verified install resolves from NuGet global cache via --add-source when available
  • All existing C# tests pass

dotnet tool exec has a known bug (dotnet/sdk#51375) where it fails to
authenticate against private NuGet feeds, returning 401 even when
credentials are properly configured. Replace dotnet tool exec with
dotnet tool install --tool-path + direct execution, which handles
authentication correctly. Tool-paths are version-specific to avoid
file-lock conflicts during parallel execution.
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Apr 10, 2026
@macsux macsux merged commit 955a86b into main Apr 10, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Apr 10, 2026
@macsux macsux deleted the macsux/dotnet-tool-auth-fix branch April 10, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant