简体   繁体   中英

Automatic Nuget package restore in Visual Studio Online fails

I've verified that it works locally by deleting all of the packages from the packages folder, opening up visual studio and then building my project - all of the packages are downloaded first and then it builds.

I do not have a .nuget folder and in the visual studio options I've allowed Nuget to download missing packages.

When building using TFS I get a ton of errors that I do not get when building locally. I believe this to be related to

Thoughts?

在此处输入图片说明

I had the same problem when building a new project with Visual Studio Online and found this solution :

  1. In VS enable Nuget Package Restore (rt click on solution in solution explorer) 在此处输入图片说明
  2. Remove solution /Packages folder from both local workspace and Visual Studio Online Version control. (Thanks Robert)
  3. Confirm build works locally
  4. Check-in changes: 3 Nuget files & modified .sln and .csproj
  5. trigger build

NuGet should restore the local packages when you build and will also restore after VSO build. Version control will not have a packages folder, but the required packages end up on the release server. I trigger a release manager with each build and deploy with DSC.

NuGet documentation ( 1 & 2 )doesn't explain how that works and I've had to 'toggle' this on & off once to get builds to work after. I've emailed support@nuget.org to ask for more detail and clearer documentation.

You should not have to checkin packages to source control. But you'll need to help MSBuild restoring that.

Check this link: http://docs.nuget.org/docs/reference/package-restore-with-team-build

The trick is the MSBuild .proj file you have to create and reference there your solutions.

Nuget 2.7 is required

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM