How to disable a Nuget Feed in a .NET project

Most of us use private Feeds in Nuget for storing our Nuget Packages. However, since some projects might have other security restrictions that others, it is possible that we want to disable some Feeds in our project, so that we do not have them as references.

To do this “black-listing” of Feeds you can use the following configuration:

The new Nuget.Config file should now look like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <disabledPackageSources>
        <add key="XXXX" value="true" />
        ... Other packageSources you do NOT want
    </disabledPackageSources>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    ... Other packageSources you want
  </packageSources>
  ... Remaining configuration
</configuration>
comments powered by Disqus