Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy
Visual Studio

Visual Studio: Fix a NuGet Restore That Succeeds on Your Machine but Fails on a Teammate’s

- 03.10.26 - ErcanOPAK

🔧 The Restore That Only Worked on One Specific Laptop

A solution that restores its NuGet packages cleanly for one developer and fails with unresolved package errors for another, on the exact same commit, almost always comes down to a difference in what each machine’s NuGet configuration considers a valid package source – a private feed reachable only on a corporate VPN, a locally-cached package that exists in one developer’s global packages folder but was never actually published anywhere a fresh machine could reach it, or a nuget.config file that references a feed URL correctly for one person’s authentication setup and not the other’s. The solution file and the project files are identical for both people; what differs is invisible, machine-local configuration that never gets committed to source control at all.

🔎 The Problem

Developer A (restore succeeds):
  - VPN connected, has access to the internal NuGet feed at
    https://nuget.internal.company.com/v3/index.json
  - That feed is listed in %AppData%\NuGet\NuGet.Config - a
    machine-level file, NOT part of the repository

Developer B (restore fails, same commit, same solution):
  - Not on VPN at the moment, or never had that feed added to
    their own local NuGet.Config in the first place
  - Visual Studio reports packages as "not found" purely because
    THIS machine's list of package sources doesn't include the
    one place those specific packages actually live

Nothing about the project files differs between the two - the
missing piece lives entirely in machine-local configuration that
git has no way to see or track.

✅ Fix: Make the Package Source List Part of the Repository, Not the Machine

  • Adding a nuget.config file at the solution root, committed to the repository, with every required package source (including internal feeds) listed explicitly, removes the dependency on each individual developer’s own machine-level NuGet configuration having been set up correctly and identically.
  • Documenting any required VPN or network access needed to reach an internal feed directly in the project’s onboarding notes, right next to the committed nuget.config, turns a confusing ‘restore just doesn’t work for me’ report into an obvious, checkable first step for a new team member.
  • Running dotnet nuget list source (or checking Visual Studio’s NuGet Package Manager > Package Sources settings) on a failing machine quickly reveals exactly which sources that specific installation considers valid, making the comparison against a working machine’s list fast rather than guesswork.

⚠️ Why This Looks Like a Project Problem and Isn’t

  • NuGet package sources are, by default, a per-machine (or per-user) setting rather than something stored inside the solution or project files – which is exactly why two people can have an identical checkout of the exact same commit and get completely different restore results.
  • This is especially common right after a new developer joins a team, or after a work laptop is reimaged or replaced, since both situations start from NuGet’s default configuration with none of the project-specific feeds anyone else already quietly added to their own machine months ago.

A NuGet restore failure that only happens on one machine isn’t a broken project – it’s a project that’s been quietly depending on configuration nobody ever told git about.

— Visual Studio Best Practice

Related posts:

Visual Studio: Fix the XAML Designer That Crashes Every Time You Open a Specific File

Visual Studio: Fix the XAML Designer That Crashes Every Time You Open a Specific File

Stop Visual Studio From Silently Using the Wrong Build Configuration

Stop Visual Studio From Silently Using the Wrong Build Configuration

Visual Studio: Use Code Maps to Visualize Dependencies

Visual Studio: Use Code Maps to Visualize Dependencies

Views: 10

Post navigation

Ajax: Fix a Fetch Request That Silently Drops Your Custom Headers on Redirect
HTML5: Fix a Form That Submits on Enter From One Input but Not Another

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,068)
  • Get the User Name and Domain Name from an Email Address in SQL (990)
  • How to add default value for Entity Framework migrations for DateTime and Bool (986)
  • Get the First and Last Word from a String or Sentence in SQL (865)
  • How to select distinct rows in a datatable in C# (859)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (661)
  • Add Constraint to SQL Table to ensure email contains @ (619)
  • Average of all values in a column that are not zero in SQL (577)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (553)
  • Find numbers with more than two decimal places in SQL (482)

Recent Posts

  • Network Speed Monitor Windows Application v2.5.1
  • Ağ Hızı İzleyici Windows Uygulaması v2.5.1
  • How to make theater mode the default for Youtube
  • The AI Prompt That Audits a Function for Thread-Safety Gaps
  • Ajax: Fix a Fetch Request Caching a Response Despite No-Store
  • WordPress: Fix a Navigation Block Losing Submenu Items After Sync
  • Visual Studio: Fix CodeLens Reference Counts Stuck at Stale Numbers
  • C#: Fix a UTF-8 String Literal Behaving Differently in a Switch
  • Photoshop: Fix a Liquify Mesh Snapping Back on a Smart Object
  • The AI Prompt That Turns a Crash Dump Into a Short Repro Script

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,068)
  • Get the User Name and Domain Name from an Email Address in SQL (990)
  • How to add default value for Entity Framework migrations for DateTime and Bool (986)
  • Get the First and Last Word from a String or Sentence in SQL (865)
  • How to select distinct rows in a datatable in C# (859)

Recent Posts

  • Network Speed Monitor Windows Application v2.5.1
  • Ağ Hızı İzleyici Windows Uygulaması v2.5.1
  • How to make theater mode the default for Youtube
  • The AI Prompt That Audits a Function for Thread-Safety Gaps
  • Ajax: Fix a Fetch Request Caching a Response Despite No-Store

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com