Update. With Matt Ward's help I traced this to a bad config file. The following ~/.config/NuGet/NuGet.Config works for me
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" protocolVersion="2" />
</packageSources>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
I can do the following without any problems:
/opt/mono/mono-5.2.0.196-tarball/bin/mono ~/nuget.exe install -version 2.6.4 nunit
However, when I try to compile fsharp under the same installation of Mono, I get the following error. This is in the fsharp4 branch. What might I be doing wrong, please? Many thanks.
Project "/dir/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj" (default target(s)): Target CallFsSrGen: Created directory "obj/proto/./" Tool /dir/src/fsharp/FSharp.Build-proto/../../../lib/bootstrap/4.0/fssrgen.exe execution started with arguments: /dir/src/fsharp/FSharp.Build/FSBuild.txt obj/proto/./FSBuild.fs FSBuild.resx Target BeforeBuild: Executing: mono --runtime=v4.0.30319 /dir/src/fsharp/FSharp.Build-proto/../../../.nuget/NuGet.exe restore packages.config -PackagesDirectory packages Unable to find version '2.6.4' of package 'NUnit'. Unable to find version '2.6.4' of package 'NUnit.Runners'. /dir/src/FSharpSource.targets: error : Command 'mono --runtime=v4.0.30319 /dir/src/fsharp/FSharp.Build-proto/../../../.nuget/NuGet.exe restore packages.config -PackagesDirectory packages' exited with code: 1. Task "Exec" execution -- FAILED Done building target "BeforeBuild" in project
~/.config/NuGet/NuGet.config. I suspect that it only has the v3 package source:https://api.nuget.org/v3/index.json. So you would either need to update the nuget.exe to a later version or add the NuGet v2 package source into your NuGet.Config file:https://www.nuget.org/api/v2/- Matt Ward