1

I am trying to run the "Visual studio build task" in VSTS CI, but its failing with the following error:

Build error

I read it here bclbuildWhat does the Microsoft.Bcl.Build NuGet package do?

and passed the MSBuild arguments as /p:BclBuildImported=Ignore but still it complains that nuget restore didn't occur. What could be the problem?

Nuget restore task:

Nuget-restore task

Ashutosh Kumar
  • 61
  • 1
  • 10

1 Answers1

0

Firstly make sure you can build the project locally with VS. Then add Nuget Restore task in the build definition to restore the packages.


UPDATE:

Just check your Nuget.config file, make sure you have set the correct feeds/package sources you want to consume and the package Microsoft.Bcl.Build.1.0.21 is included in the sources.

See Specifying sources in NuGet.config for details.

Besides, you can also try to create a new build definition with the Nuget restore task, then provide the nuget.config file and proper path to solution, also try with other Hosted agents.

enter image description here

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • 1
    I have created the nuget restore task, – Ashutosh Kumar Jul 02 '18 at 05:49
  • please take a look at the image attached in the above post. just now i posted that task's screen shot. – Ashutosh Kumar Jul 02 '18 at 06:05
  • @AshutoshKumar Just check your `Nuget.config` file, make sure you have set the correct `feeds/package sources` you want to consume and the package `Microsoft.Bcl.Build.1.0.21` is included in the sources. See [Specifying sources in NuGet.config](https://learn.microsoft.com/en-us/vsts/pipelines/packages/nuget-restore?view=vsts#specifying-sources-in-nugetconfig) for details. – Andy Li-MSFT Jul 02 '18 at 06:48
  • 1
    Thanks i will check and try building again. – Ashutosh Kumar Jul 02 '18 at 06:59
  • @AshutoshKumar Have you resolved the issue? any update? – Andy Li-MSFT Jul 04 '18 at 01:57
  • 1
    This problem is solved now, thanks for the help, i created a fresh task and gave feeds to use: Feeds in my nuget.config. Gave the proper path to solution and it built. The project was building fine in the local. I also changed Host to Host VS2017 – Ashutosh Kumar Jul 13 '18 at 17:42
  • @AshutoshKumar Glad to know that you have resolved the issue, I also updated the answer with your comments, you could [Accept it as an Answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work), This can be beneficial to other community members reading this thread – Andy Li-MSFT Jul 14 '18 at 02:21