VSTS Nuget Installer fails to authenticate with package feed

时光怂恿深爱的人放手 提交于 2019-12-23 01:13:21

问题


I have a package feed on VSTS providing several packages that I reference in a solution that is also being built on VSTS. The builds have suddenly started failing at the package restore phase with the logs indicating that it cannot find the dlls nuget is supposed to restore.

Restoring NuGet package Basd.Diagnostics.0.7.0.

WARNING: Unable to find version '0.7.0' of package 'Basd.Diagnostics'.

The public / private feeds are listed in my nuget.config and they also show up in the build logs "Using Feeds..." so it's not a matter of the restore operation not being able to find the actual feeds for the package. It's more like it can't authenticate and therefore can't retrieve the package from the feed.

If I look at the history for the build definition there is a change from when it last worked to now and that is this:

  "build": [
    {
      "enabled": true,
      "continueOnError": false,
      "alwaysRun": false,
      "displayName": "NuGet restore MySol.sln",
      "timeoutInMinutes": 0,
      "task": {
        "id": "333b11bd-d341-40d9-afcf-b32d5ce6f23b",
        "versionSpec": "*",
        "definitionType": "task"
      },
      "inputs": {
        "solution": "Basd.Core.sln",
        "nugetConfigPath": "nuget.config",
        "restoreMode": "restore",
        "noCache": "false",
        "nuGetRestoreArgs": "",
        "verbosity": "",
        "nuGetPath": "",
        "preCredProviderNuGet": "false"
      }
    },

There is now a "preCredProviderNuGet": "false" field in the definition. I've googled but I can't find out how and where this is set but I'm assuming this is preventing authentication to my feed which in turn is why the restore operation fails.

So where is this setting and/or how do I turn it back on or remove it as an entry? In the working build def, it was not set to true, it just didn't exist.

Is it a VSTS UI related field or something I set in nuget.config files? I'm assuming the former because again doing a diff suggests nothing has changed in my nuget.config between working and non working builds.


回答1:


This seems to be caused by the VSTS issue which should be fixed by now, please try the build agent.

Issue: Packaging issues with Visual Studio Team Services – 7/30 – Resolved




回答2:


The "preCredProviderNuGet" setting is not related to your problem. The NuGet Restore task has additional advanced settings, "Path to NuGet.exe" and the corresponding checkbox "Path to NuGet.exe is below version 3.2". These settings correspond to the nuGetPath and preCredProviderNuGet settings in the build json. In usage, preCredProviderNuGet only has an impact if the nuGetPath is also set, and is a signal to the task that the version of NuGet in use will not be able to employ the credential provider, since plugin credential providers are not supported prior to v3.2

One suggestion would be to set this task's verbosity to "Detailed", and rerun the build. You will find that in NuGet Restore task \ Advanced \ Verbosity.



来源:https://stackoverflow.com/questions/38679316/vsts-nuget-installer-fails-to-authenticate-with-package-feed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!