Bacancy Technology
Bacancy Technology represents the connected world, offering innovative and customer-centric information technology experiences, enabling Enterprises, Associates and the Society to Rise™.
12+
Countries where we have happy customers
1050+
Agile enabled employees
06
World wide offices
12+
Years of Experience
05
Agile Coaches
14
Certified Scrum Masters
1000+
Clients projects
1458
Happy customers
Artificial Intelligence
Machine Learning
Salesforce
Microsoft
SAP
May 9, 2024
The question delves into the distinction between two NuGet restore commands within an Azure build pipeline:
task: NuGetCommand@2 inputs: restoreSolution: '$(solution)’
This task is utilized for installing and updating NuGet package dependencies, or packaging and publishing NuGet packages. It employs NuGet.exe and functions with .NET Framework applications.
task: DotNetCoreCLI@2 inputs: command: 'restore' projects: '$(solution)' feedsToUse: 'select'
This task utilizes dotnet restore, which internally uses a version of NuGet.exe packaged with the .NET Core SDK. dotnet restore solely restores packages specified in the .NET Core project’s .csproj files.
The difference lies in the scope of dependency resolution:
Regarding feedsToUse: ‘select’, it indicates selecting packages cached in Azure Artifacts with upstream sources. This is essential for restoring packages from an external custom feed. Conversely, when such packages aren’t required, the path to the .csproj file(s) should be specified directly in the projects parameter, as shown in the latter example:
- task: DotNetCoreCLI@2 displayName: 'dotnet restore' inputs: command: restore projects: '**/*.csproj'
This specifies that all .csproj files within the repository should be considered for package restoration.
For further details and syntax, relevant links from Microsoft documentation are provided.