如何在Azure DevOps中指定与自托管代理一起使用的nuget.exe版本?

问题描述

我正在运行自托管代理,NuGetToolInstaller总是抛出错误ERR:unable to get local issuer certificate

我发现了一个修复程序here。只是要将所需的nuget.exe版本下载到计算机上,将其添加到环境变量中并完全删除NuGetToolInstaller。它解决了这个问题,但是今天我知道事实并非如此。

当前,我有nuget.exe version 5.6.0,所以我认为自托管代理会使用它,但是...

运行Initialize Job Azure时会下载NuGetCommand

enter image description here

我找到了该位置,可以看到它下载了nuget.exe的三个不同版本

enter image description here

对于任何NuGetCommand,它始终使用4.1.0

enter image description here

如何指定不使用NuGetToolInstaller的NuGet版本?

或者如何使Initialize Job 下载任何nuget.exe并仅使用系统中可用的那个文件?

为了进行测试,我从yaml中删除了所有内容,看起来像这样:

trigger:
- master
pool:
  name: somePool    
jobs:
- job: someJob  
  variables:
      solution: '**/*.sln'
      buildPlatform: 'Any CPU'
      buildConfiguration: 'Release'  
  steps:
    - task: NuGetCommand@2
      inputs:
        restoreSolution: '$(solution)'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)