This is my original YML file.
trigger:
- master
pool:
vmImage: 'Ubuntu-16.04'
variables:
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@0
displayName: "NuGet use 4.9.3"
inputs:
versionSpec: 4.9.3
- task: DotNetCoreInstaller@0
inputs:
version: '2.2.104'
- task: NuGetCommand@2
displayName: "NuGet Restore"
inputs:
restoreSolution: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: ".NET build"
inputs:
projects: '**/*.csproj'
arguments: --configuration $(BuildConfiguration) --no-restore
- task: DotNetCoreCLI@2
displayName: ".NET publish package"
inputs:
command: publish
arguments: '--configuration $(BuildConfiguration) --no-restore --output $(Build.ArtifactStagingDirectory)/app/pkg'
This is the output I get for the Nuget Restore step.
[section]Starting: NuGet restore ============================================================================== Task : NuGet Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task. Version : 2.147.6 Author : Microsoft Corporation Help : More Information ============================================================================== Caching tool: NuGet 4.1.0 x64 Found tool in cache: NuGet 4.1.0 x64 Resolved from tool cache: 4.1.0 Using version: 4.1.0 Found tool in cache: NuGet 4.1.0 x64
How do I disable the use of "tool cache"? It is using 4.1.0 instead of 4.9.3.
UPDATE: As recommended by the comments, I updated my YML file.
trigger:
- master
pool:
vmImage: 'vs2017-win2016'
variables:
buildConfiguration: 'Release'
steps:
- task: DotNetCoreCLI@2
inputs:
command: restore
- task: DotNetCoreCLI@2
displayName: ".NET build"
inputs:
projects: '**/*.csproj'
arguments: --configuration $(BuildConfiguration) --no-restore
- task: DotNetCoreCLI@2
displayName: ".NET publish package"
inputs:
command: publish
arguments: '--configuration $(BuildConfiguration) --no-restore --output $(Build.ArtifactStagingDirectory)/app/pkg'
I still get errors.
It's still doing the same thing.
Starting NuGet restore
Task : NuGet Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task. Version : 2.147.6 Author : Microsoft Corporation Help : More Information h t t p s ://go.microsoft.com/fwlink/?LinkID=613747
Caching tool: NuGet 4.1.0 x64 Found tool in cache: NuGet 4.1.0 x64 Resolved from tool cache: 4.1.0 Using version: 4.1.0 Found tool in cache: NuGet 4.1.0 x64 SYSTEMVSSCONNECTION exists true SYSTEMVSSCONNECTION exists true [command]C:\windows\system32\chcp.com 65001 Active code page: 65001 Detected NuGet version 4.1.0.2450 / 4.1.0 SYSTEMVSSCONNECTION exists true Saving NuGet.config to a temporary config file. [command]C:\hostedtoolcache\windows\NuGet\4.1.0\x64\nuget.exe sources Add -NonInteractive -Name NuGetOrg -Source https://www.nuget.org/api/v2/ -ConfigFile d:\a\1\Nuget\tempNuGet_57.config Package Source with Name: NuGetOrg added successfully. Saving NuGet.config to a temporary config file.
Why is it even doing a Nuget Restore when it is no longer in my YML file?
noCache: true
to the NuGet restore task. – Shayki Abramczykdotnet restore
. – Daniel Mann