Skip to content

Commit 8b794e0

Browse files
fix(nuget): clear inherited sources so restore is deterministic (#214) (#240)
The root nuget.config previously relied on additive merging with the user-level %APPDATA%\NuGet\NuGet.Config. On machines that have any authenticated <packageSource> entries at the user level (common in enterprise developer setups), `dotnet restore` fans every package out against every inherited feed, fails authentication, retries, and can hang 14+ minutes producing hundreds of NU1301 errors before completing — the very first command a new contributor runs. Add <clear /> inside <packageSources> so only reactor-local and nuget.org are used. Also clear <disabledPackageSources> so a user-level disabled entry can't silently turn one of them off. This matches the convention already used by the repo's own test-fixture NuGet.configs (tests/startup_perf/BlankRNW, tests/stress_perf_rn/*). Verified `dotnet nuget list source` shows only the two intended sources and a fresh restore of src/Reactor.Cli completes cleanly. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 242b8e2 commit 8b794e0

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

nuget.config

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,18 @@
66
scaffolded apps under this repo use #:package Microsoft.UI.Reactor and
77
resolve through this feed.
88
9-
nuget.org remains the source for everything else (Microsoft.WindowsAppSDK
10-
and friends). It's added explicitly here so this file is self-contained
11-
— global sources still apply additively. -->
9+
nuget.org is the only public source we need (Microsoft.WindowsAppSDK and
10+
friends resolve from there). We <clear /> first so user-level sources
11+
from %APPDATA%\NuGet\NuGet.Config (often authenticated enterprise feeds)
12+
don't get merged in. Without this, `dotnet restore` on a fresh clone
13+
fans every package out against every inherited feed and can hang for
14+
minutes on auth failures — see issue #214. -->
1215
<packageSources>
16+
<clear />
1317
<add key="reactor-local" value="local-nupkgs" />
1418
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
1519
</packageSources>
20+
<disabledPackageSources>
21+
<clear />
22+
</disabledPackageSources>
1623
</configuration>

0 commit comments

Comments
 (0)