Where is the nuget packages folder located on a hosted build server using TFS?
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
add a comment |
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
add a comment |
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
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
azure-devops continuous-deployment
asked Jan 10 '17 at 1:46
trevorctrevorc
1,75542343
1,75542343
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
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:
- Add NuGet restore or .Net Core Restore build step to restore packages
- Add PowerShell build step to list files in C:Usersbuildguest.nugetpackages
Code:
Get-ChildItem -Path C:Usersbuildguest.nugetpackages
- Queue build and check the PowerShell step log (the packages’ will be listed in the log)
- Remove/disable NuGet restore or .Net Core Restore build step > Save build definition
- Queue build
- 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.
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
add a comment |
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.
add a comment |
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.
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.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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:
- Add NuGet restore or .Net Core Restore build step to restore packages
- Add PowerShell build step to list files in C:Usersbuildguest.nugetpackages
Code:
Get-ChildItem -Path C:Usersbuildguest.nugetpackages
- Queue build and check the PowerShell step log (the packages’ will be listed in the log)
- Remove/disable NuGet restore or .Net Core Restore build step > Save build definition
- Queue build
- 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.
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
add a comment |
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:
- Add NuGet restore or .Net Core Restore build step to restore packages
- Add PowerShell build step to list files in C:Usersbuildguest.nugetpackages
Code:
Get-ChildItem -Path C:Usersbuildguest.nugetpackages
- Queue build and check the PowerShell step log (the packages’ will be listed in the log)
- Remove/disable NuGet restore or .Net Core Restore build step > Save build definition
- Queue build
- 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.
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
add a comment |
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:
- Add NuGet restore or .Net Core Restore build step to restore packages
- Add PowerShell build step to list files in C:Usersbuildguest.nugetpackages
Code:
Get-ChildItem -Path C:Usersbuildguest.nugetpackages
- Queue build and check the PowerShell step log (the packages’ will be listed in the log)
- Remove/disable NuGet restore or .Net Core Restore build step > Save build definition
- Queue build
- 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.
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:
- Add NuGet restore or .Net Core Restore build step to restore packages
- Add PowerShell build step to list files in C:Usersbuildguest.nugetpackages
Code:
Get-ChildItem -Path C:Usersbuildguest.nugetpackages
- Queue build and check the PowerShell step log (the packages’ will be listed in the log)
- Remove/disable NuGet restore or .Net Core Restore build step > Save build definition
- Queue build
- 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 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
add a comment |
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
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
add a comment |
add a comment |
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.
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.
add a comment |
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.
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.
add a comment |
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.
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.
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.
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.
answered Sep 21 '18 at 9:09
Ibrahim Ç.Ibrahim Ç.
2816
2816
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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