I am trying to push package from Linux via dotnet-cli.
I have my own nuget server - via package https://www.nuget.org/packages/NuGet.Server/
Using following command:
dotnet nuget push mypackage.nupkg
I have XML config with package source:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<config>
<add key="DefaultPushSource" value="https://mynuget.azurewebsites.net/api/v2/package" />
</config>
<packageSources>
<add key="MyNuget" value="https://mynuget.azurewebsites.net/api/v2/package" />
</packageSources>
<packageSourceCredentials>
<MyNuget>
<add key="Username" value="user" />
<add key="ClearTextPassword" value="pass" />
</MyNuget>
</packageSourceCredentials>
<apikeys>
<add key="https://mynuget.azurewebsites.net/" value="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAV4A39UQG0kyF2wMV56X9wQAAAAACAAAAAAAQZgAAAAEAACAAAAABPigYqsJ8B9Vcs2e6SXGUKbqctjmrNyoUQz/6H7FSWwAAAAAOgAAAAAIAACAAAAAhm/tVYS41jbvn9NIL6IPHFSFDpBDL/fbBXzdTBSRvWRAAAACY41RYMpAJoSeSdq5paZCvQAAAADZRmyl+f4XYYnPpi1Ia9Kf0TsM6ddNXUL2sJIWXtQ6zNOliZ1IGlpU62c83v93siZp7GCRjj9fIoG6ixbK2Rxg=" />
</apikeys>
</configuration>
Error message which I am getting is:
warn : No API Key was provided and no API Key could be found for 'https://mynuget.azurewebsites.net/api/v2/package'.
To save an API Key for a source use the 'setApiKey' command.
info : Pushing mypackage.nupkg to 'https://mynuget.azurewebsites.net/api/v2/package'...
info : PUT https://mynuget.azurewebsites.net/api/v2/package/
info : Forbidden https://mynuget.azurewebsites.net/api/v2/package/ 3898ms
It seems that nuget.config is completely ignored by dotnet-cli?
I also cannot pass --config-file
parameter - getting error error: Unrecognized option '--config-file'
but it should be possible as per documentation:
https://github.com/dotnet/docs/blob/master/docs/core/tools/dotnet-nuget-push.md