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












2















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:usersme.nuget*



I've tried every permutation of that on TFS without success. I've also tried mydirpackages 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.










share|improve this question



























    2















    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:usersme.nuget*



    I've tried every permutation of that on TFS without success. I've also tried mydirpackages 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.










    share|improve this question

























      2












      2








      2


      1






      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:usersme.nuget*



      I've tried every permutation of that on TFS without success. I've also tried mydirpackages 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.










      share|improve this question














      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:usersme.nuget*



      I've tried every permutation of that on TFS without success. I've also tried mydirpackages 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.







      azure-devops continuous-deployment






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 10 '17 at 1:46









      trevorctrevorc

      1,75542343




      1,75542343
























          3 Answers
          3






          active

          oldest

          votes


















          1














          The Nuget package cache folder is in C:Usersbuildguest.nugetpackages, 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:Usersbuildguest.nugetpackages


          Code:



          Get-ChildItem -Path C:Usersbuildguest.nugetpackages



          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.






          share|improve this answer
























          • That was is it! Thanks a bunch. Side question, is that path consistent? e.g. A variable for that path. $(Foo). Could not find one for that location.

            – trevorc
            Jan 10 '17 at 14:45











          • @trevorc There isn't the build-in variable for that path.

            – starian chen-MSFT
            Jan 11 '17 at 1:34



















          4














          With the latest nuget/msbuild the packages folder is held under the active user's profile directory, so an appropriate Powershell command is



          Get-ChildItem $(UserProfile).nugetpackages 


          This currently evaluates on the VSTS 2017 Hosted build agent to C:UsersVssAdministrator.nugetpackages but by using the variable you are insulated from any changes made.






          share|improve this answer

































            1














            Just an addition to @Paul Hatcher's answer:



            I also faced the same problem in Azure DevOps build pipeline where a specific package and nuget packages directory could not be found.
            It is a Xamarin.Forms app based on a .net standard library where no packages folder exists. I later noticed in build logs that the packages are restored to nuget folder under user's profile. However this particular case is not documented on https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=vsts#agent-variables.



            enter image description here



            That means @Paul Hatcher's answer is also valid if you try to reference nuget package folder directly from your build pipeline. This ($(UserProfile).nugetpackages) should actually be a (standard) predefined build variable.






            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41559902%2fwhere-is-the-nuget-packages-folder-located-on-a-hosted-build-server-using-tfs%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              The Nuget package cache folder is in C:Usersbuildguest.nugetpackages, 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:Usersbuildguest.nugetpackages


              Code:



              Get-ChildItem -Path C:Usersbuildguest.nugetpackages



              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.






              share|improve this answer
























              • That was is it! Thanks a bunch. Side question, is that path consistent? e.g. A variable for that path. $(Foo). Could not find one for that location.

                – trevorc
                Jan 10 '17 at 14:45











              • @trevorc There isn't the build-in variable for that path.

                – starian chen-MSFT
                Jan 11 '17 at 1:34
















              1














              The Nuget package cache folder is in C:Usersbuildguest.nugetpackages, 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:Usersbuildguest.nugetpackages


              Code:



              Get-ChildItem -Path C:Usersbuildguest.nugetpackages



              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.






              share|improve this answer
























              • That was is it! Thanks a bunch. Side question, is that path consistent? e.g. A variable for that path. $(Foo). Could not find one for that location.

                – trevorc
                Jan 10 '17 at 14:45











              • @trevorc There isn't the build-in variable for that path.

                – starian chen-MSFT
                Jan 11 '17 at 1:34














              1












              1








              1







              The Nuget package cache folder is in C:Usersbuildguest.nugetpackages, 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:Usersbuildguest.nugetpackages


              Code:



              Get-ChildItem -Path C:Usersbuildguest.nugetpackages



              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.






              share|improve this answer













              The Nuget package cache folder is in C:Usersbuildguest.nugetpackages, 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:Usersbuildguest.nugetpackages


              Code:



              Get-ChildItem -Path C:Usersbuildguest.nugetpackages



              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.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jan 10 '17 at 8:13









              starian chen-MSFTstarian chen-MSFT

              25.3k1926




              25.3k1926













              • That was is it! Thanks a bunch. Side question, is that path consistent? e.g. A variable for that path. $(Foo). Could not find one for that location.

                – trevorc
                Jan 10 '17 at 14:45











              • @trevorc There isn't the build-in variable for that path.

                – starian chen-MSFT
                Jan 11 '17 at 1:34



















              • That was is it! Thanks a bunch. Side question, is that path consistent? e.g. A variable for that path. $(Foo). Could not find one for that location.

                – trevorc
                Jan 10 '17 at 14:45











              • @trevorc There isn't the build-in variable for that path.

                – starian chen-MSFT
                Jan 11 '17 at 1:34

















              That was is it! Thanks a bunch. Side question, is that path consistent? e.g. A variable for that path. $(Foo). Could not find one for that location.

              – trevorc
              Jan 10 '17 at 14:45





              That was is it! Thanks a bunch. Side question, is that path consistent? e.g. A variable for that path. $(Foo). Could not find one for that location.

              – trevorc
              Jan 10 '17 at 14:45













              @trevorc There isn't the build-in variable for that path.

              – starian chen-MSFT
              Jan 11 '17 at 1:34





              @trevorc There isn't the build-in variable for that path.

              – starian chen-MSFT
              Jan 11 '17 at 1:34













              4














              With the latest nuget/msbuild the packages folder is held under the active user's profile directory, so an appropriate Powershell command is



              Get-ChildItem $(UserProfile).nugetpackages 


              This currently evaluates on the VSTS 2017 Hosted build agent to C:UsersVssAdministrator.nugetpackages but by using the variable you are insulated from any changes made.






              share|improve this answer






























                4














                With the latest nuget/msbuild the packages folder is held under the active user's profile directory, so an appropriate Powershell command is



                Get-ChildItem $(UserProfile).nugetpackages 


                This currently evaluates on the VSTS 2017 Hosted build agent to C:UsersVssAdministrator.nugetpackages but by using the variable you are insulated from any changes made.






                share|improve this answer




























                  4












                  4








                  4







                  With the latest nuget/msbuild the packages folder is held under the active user's profile directory, so an appropriate Powershell command is



                  Get-ChildItem $(UserProfile).nugetpackages 


                  This currently evaluates on the VSTS 2017 Hosted build agent to C:UsersVssAdministrator.nugetpackages but by using the variable you are insulated from any changes made.






                  share|improve this answer















                  With the latest nuget/msbuild the packages folder is held under the active user's profile directory, so an appropriate Powershell command is



                  Get-ChildItem $(UserProfile).nugetpackages 


                  This currently evaluates on the VSTS 2017 Hosted build agent to C:UsersVssAdministrator.nugetpackages but by using the variable you are insulated from any changes made.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 23 '18 at 19:43









                  Brandon Minnick

                  6,525123175




                  6,525123175










                  answered Jan 30 '18 at 11:39









                  Paul HatcherPaul Hatcher

                  2,4412724




                  2,4412724























                      1














                      Just an addition to @Paul Hatcher's answer:



                      I also faced the same problem in Azure DevOps build pipeline where a specific package and nuget packages directory could not be found.
                      It is a Xamarin.Forms app based on a .net standard library where no packages folder exists. I later noticed in build logs that the packages are restored to nuget folder under user's profile. However this particular case is not documented on https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=vsts#agent-variables.



                      enter image description here



                      That means @Paul Hatcher's answer is also valid if you try to reference nuget package folder directly from your build pipeline. This ($(UserProfile).nugetpackages) should actually be a (standard) predefined build variable.






                      share|improve this answer




























                        1














                        Just an addition to @Paul Hatcher's answer:



                        I also faced the same problem in Azure DevOps build pipeline where a specific package and nuget packages directory could not be found.
                        It is a Xamarin.Forms app based on a .net standard library where no packages folder exists. I later noticed in build logs that the packages are restored to nuget folder under user's profile. However this particular case is not documented on https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=vsts#agent-variables.



                        enter image description here



                        That means @Paul Hatcher's answer is also valid if you try to reference nuget package folder directly from your build pipeline. This ($(UserProfile).nugetpackages) should actually be a (standard) predefined build variable.






                        share|improve this answer


























                          1












                          1








                          1







                          Just an addition to @Paul Hatcher's answer:



                          I also faced the same problem in Azure DevOps build pipeline where a specific package and nuget packages directory could not be found.
                          It is a Xamarin.Forms app based on a .net standard library where no packages folder exists. I later noticed in build logs that the packages are restored to nuget folder under user's profile. However this particular case is not documented on https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=vsts#agent-variables.



                          enter image description here



                          That means @Paul Hatcher's answer is also valid if you try to reference nuget package folder directly from your build pipeline. This ($(UserProfile).nugetpackages) should actually be a (standard) predefined build variable.






                          share|improve this answer













                          Just an addition to @Paul Hatcher's answer:



                          I also faced the same problem in Azure DevOps build pipeline where a specific package and nuget packages directory could not be found.
                          It is a Xamarin.Forms app based on a .net standard library where no packages folder exists. I later noticed in build logs that the packages are restored to nuget folder under user's profile. However this particular case is not documented on https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=vsts#agent-variables.



                          enter image description here



                          That means @Paul Hatcher's answer is also valid if you try to reference nuget package folder directly from your build pipeline. This ($(UserProfile).nugetpackages) should actually be a (standard) predefined build variable.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Sep 21 '18 at 9:09









                          Ibrahim Ç.Ibrahim Ç.

                          2816




                          2816






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41559902%2fwhere-is-the-nuget-packages-folder-located-on-a-hosted-build-server-using-tfs%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Costa Masnaga

                              Fotorealismo

                              Sidney Franklin