I have a build server for .net. I am trying a quick poc of connecting to Azure Dev Ops and dropping a .nupkg file into a feed without interaction.
Here are the steps I have taken:
-
Set System EV of VSS_NUGET_EXTERNAL_FEED_ENDPOINTS
setx VSS_NUGET_EXTERNAL_FEED_ENDPOINTS “{“uri”:””,”username”:””,”password”:”<My_PAT>”}”
-
Installed Microsoft.NuGet.CredentialProvider and add the System EV
setx NUGET_PLUGIN_PATHS “C:PathToCredentialProvider”
-
Created the Nuget.config with my package sources defined (once I implemented CredentialProvider, I stripped out the section on package source credentials per chatgpt advice, though i did try it with them in there)
I’ve tried a number of command variations, none of have worked. (source/apikey is blank in the example but I have the correct values as far as I know)
nuget push “IML.Core.Constants.1.0.0.nupkg” -Source “” -ConfigFile “c:nugetNuget.config” -ApiKey “” -Verbosity detailed
I’ve also tried “-ApiKey VSTS” per chatgpt suggestion.
The error of the exact command above is:
[CredentialProvider]VstsBuildTaskServiceEndpointCredentialProvider –
Error happened while parsing json: System.NullReferenceException:
Object reference not set to an instance of an object. at
NuGetCredentialProvider.CredentialProviders.VstsBuildTaskServiceEndpoint.VstsBuildTaskServiceEndpointCredentialProvider.ParseJsonToDictionary()
in
D:a_work1sCredentialProvider.MicrosoftCredentialProvidersVstsBuildTaskServiceEndpointVstsBuildTaskServiceEndpointCredentialProvider.cs:line
123
[CredentialProvider]Failed to acquire session token: System.NullReferenceException: Object reference not set to an instance
of an object. at
NuGetCredentialProvider.CredentialProviders.VstsBuildTaskServiceEndpoint.VstsBuildTaskServiceEndpointCredentialProvider.ParseJsonToDictionary()
in
D:a_work1sCredentialProvider.MicrosoftCredentialProvidersVstsBuildTaskServiceEndpointVstsBuildTaskServiceEndpointCredentialProvider.cs:line
154 at System.Lazy1.CreateValue() at System.Lazy
1.LazyInitValue() at
NuGetCredentialProvider.CredentialProviders.VstsBuildTaskServiceEndpoint.VstsBuildTaskServiceEndpointCredentialProvider.HandleRequestAsync(GetAuthenticationCredentialsRequest
request, CancellationToken cancellationToken) in
D:a_work1sCredentialProvider.MicrosoftCredentialProvidersVstsBuildTaskServiceEndpointVstsBuildTaskServiceEndpointCredentialProvider.cs:line
66 at
NuGetCredentialProvider.RequestHandlers.GetAuthenticationCredentialsRequestHandler.d__5.MoveNext()
in
D:a_work1sCredentialProvider.MicrosoftRequestHandlersGetAuthenticationCredentialsRequestHandler.cs:line
82
[CredentialProvider]Sending response: ‘Request’ ‘GetAuthenticationCredentials’. Time elapsed in ms: 25
[CredentialProvider]Time elapsed in milliseconds after sending response ‘Request’ ‘GetAuthenticationCredentials’: 28
I suspect I’m missing some exact combination of syntax that makes this work.
Thanks for your time.