Disallow NuGet Public Gallery

We use NuGet to pack our internal dependencies. We are creating a private NuGet repository for them.

However, I am worried that someone might accidentally publish one of our packages in the public NuGet repository.

Can I prevent this?

+5
source share
2 answers

You can define a NuGet.configfile with a value DefaultPushSourcethat references your internal instance of the NuGet gallery. Place the configuration file next to your internal packages nuspec.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="DefaultPushSource" value="https://nuget.example.com" />
  </config>
</configuration>

In general, the NuGet.config file closest to the nuget.exe folder is launched from the winnings, the section below looks at the details.

NuGet NuGet.config , NuGet.config, .

NuGet Config Defaults Push . , nuget.exe. push , NuGet Config Defaults, nuget.org nuget.exe . , , . nuget.org.

Default NuGet.exe Push Source

+1

, . .

, - nuget , , - API- nuget- (, nuget.org). , Guid.NewGuid() GUID. nuget - nuget.

"". .

-3

All Articles