
We have recently decided to Implement CICD in the project ,using Azure Dev ops. We use TFS for the code check in and have the code repository in Azure Dev Ops.
Attaching the configurations we made for the project in Dev Ops pipeline.
-
why you use command line instead of native nuget task? what is the output of the command line task?Shayki Abramczyk– Shayki Abramczyk2020-06-01 08:08:49 +00:00Commented Jun 1, 2020 at 8:08
-
2020-05-29T15:17:40.6458531Z ##[command]"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "F:\Build\Agent3_work_temp\76cd57c5-84af-4101-9ed0-d58542b964a3.cmd"" 2020-05-29T15:17:40.6622697Z Write your commands here 2020-05-29T15:17:42.5026573Z MSBuild auto-detection: using msbuild version '16.4.0.56107' from 'E:\Programs\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\bin'. 2020-05-29T15:17:44.6121149Z All packages listed in packages.config are already installed.Fayaz shaik– Fayaz shaik2020-06-01 08:27:25 +00:00Commented Jun 1, 2020 at 8:27
2 Answers
Open your project in Visual Studio locally, delete all packages or packages.config file. Then right click the solution/project, select manage nuget packagesand install the packages. Now you should see the packages.config file generated. Build the project locally to see whether it is successful. If the build is successful, check in the project (don't check in the packages) with packages.config file to DevOps, and use Nuget restore and Visual Studio Build tasks to build your project.
In addition, it seems you are using a self-hosted agent. Try to go to your agent machine, clean the folder F:\Build\Agent3\_work, and check build agent to make sure you are using the latest version.
Comments
In your logs I can see you target an older version of nuget.org
https://api.nuget.org/v2
you should go instead to
https://api.nuget.org/v3/index.json
But there is no need to use command line to restore your nugets, you can use the restore task instead.
Do not forget to add any private nuget feeds if you have one.
