-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom globalPackagesFolder in NuGet.config is not used by msbuild #4810
Comments
Thanks for reporting this issue. We have not been able to reproduce this issue. If you are still able to reproduce this with the latest NuGet version, please provide additional steps. |
I am able to reproduce this. Here is my
I've tried lots of different variations for the value of NuGet Version: 4.3.0.4406 |
@daveaglick is the value of |
Nope - here's what I've got after closing VS, deleting the obj folder, reopening VS, and rebuilding:
("E:\NuGet" is my global default, so that's not unexpected if the local config isn't working) |
Where did you define this? Your user wide nuget.config? |
Well this is odd - I can't find it anywhere. I thought it was defined in "%APPDATA%\NuGet\NuGet.Config" which contains the rest of my settings, but it's not in there. I also checked all the other possible config locations according to https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-uses and can't find a config file that adjusts the default package folder. I also checked the folder tree up to the root just to be sure there wasn't one hiding in those search paths. I'm guessing this has something to do with not processing the local solution config file. Is there somewhere else that could be taking precedence (even though it's not supposed to)? |
Can you also check if the environment variable |
@jainaashish I does look like I have that set: Must have picked it up along the way and not remembered. So I think there are a few questions/problems here:
|
👍 on docs Env var wins over nuget.config files. These are typically used by a CI to override things without modifying files, it should probably keep this precedence. |
That makes perfect sense, agree it should stay. So just needs to be well documented. |
I've opened a doc bug to track this here: https://github.com/NuGet/docs.microsoft.com-nuget/issues/578 |
Migrated from original issue by @robpex at dotnet/msbuild#1861.
I found this question on StackOverflow which describes, more or less, the same problem I'm experiencing.
http://stackoverflow.com/questions/35307155/use-solution-relative-packages-folder-with-nuget-and-project-json
Basically, if you're using a custom globalPackagesFolder in your NuGet.config, msbuild is not looking in that directory. My workaround is adding "/p:NuGetPackagesDirectory=$(Build.SourcesDirectory)\Packages" to the msbuild arguments.
I couldn't find this anywhere on GitHub and it took me a while to see the suggestion of adding that argument on StackOverflow, so I thought I would go ahead and create a ticket here.
The text was updated successfully, but these errors were encountered: