PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, September 27, 2022

[FIXED] Where is the nuget packages folder located on a hosted build server using TFS?

 September 27, 2022     azure-devops, continuous-deployment     No comments   

Issue

I need to execute a command line utility from a package that is downloaded as part of nuget package restore in the TFS build process.

On my local computer that is stored in c:\users\me.nuget*

I've tried every permutation of that on TFS without success. I've also tried \mydir\packages with no success as well.

The biggest problem is that I have to run the package restore step before being able to see any sort of feedback from the log. That's some slow debugging.

Any ideas? Thanks ahead.


Solution

The Nuget package cache folder is in C:\Users\buildguest.nuget\packages, but it will be cleaned after build if you are using Hosted build server. The simple way to verify:

  1. Add NuGet restore or .Net Core Restore build step to restore packages
  2. Add PowerShell build step to list files in C:\Users\buildguest.nuget\packages

Code:

Get-ChildItem -Path C:\Users\buildguest\.nuget\packages
  1. Queue build and check the PowerShell step log (the packages’ will be listed in the log)
  2. Remove/disable NuGet restore or .Net Core Restore build step > Save build definition
  3. Queue build
  4. The build will be failed, because the path does not exist.

So, the packages need to be restored before build solution/project if aren’t existing. You can add packages to source control and map to build agent to deal with the issue of too long time takes to restore packages.



Answered By - starian chen-MSFT
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing