Search code examples
visual-studionuget

Permanently remove machine-wide package source


I've recently uninstalled Service Fabric and its SDK from my machine. However, it has left behind a machine-wide package source:

Microsoft Azure Service Fabric SDK
C:\Program Files\Microsoft SDKs\Service Fabric\packages

This folder no longer exists. It is causing my build to fail. Unticking this option as an available source doesn't seem to persist between sessions.

How can I permanently remove this package source?

UPDATE

In the Visual Studio options, delete is not available for this package source. I can untick it, but that doesn't seem to be persistent.

My NuGet.config doesn't reference it either. I can't find another NuGet.config on my computer.

Nuget Package Sources

%AppData%\NuGet\NuGet.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" />
  </packageSources>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
  <packageManagement>
    <add key="format" value="0" />
    <add key="disabled" value="False" />
  </packageManagement>
</configuration>

Solution

  • I found that deleting this file (as an Administrator) solved the problem. It must have been missed by the Service Fabric uninstaller.

    C:\Program Files (x86)\NuGet\Config\ServiceFabricSDK.config