NuGet v3
NuGet 3.x installs a NuGet.config file containing something like:
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageRestore> <add key="enabled" value="True" /> <add key="automatic" value="True" /> </packageRestore> <packageSources> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> </packageSources> <activePackageSource> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> </activePackageSource> <disabledPackageSources /> </configuration>
scriptcs uses the NuGet.Core 2.x package and that ignores the nuget.org entry due to protocolVersion="3".
As a workaround, you can add an extra package source for nuget.org v2, e.g.
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageRestore> <add key="enabled" value="True" /> <add key="automatic" value="True" /> </packageRestore> <packageSources> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> <add key="nuget.org v2" value="https://www.nuget.org/api/v2/" /> </packageSources> <activePackageSource> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> </activePackageSource> <disabledPackageSources /> </configuration>
You can also do this via the NuGet CLI:
nuget sources add -Name "nuget.org v2" -Source "https://www.nuget.org/api/v2/"
Alternatively you could add a file to your working directory named scriptcs_nuget.config, containing:
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="nuget.org v2" value="https://www.nuget.org/api/v2/" /> </packageSources> </configuration>