Open masterkawaster opened 6 years ago
I wonder if one of the NuGet packages contains the NuGet CLI's config resolution logic.
The "resolution magic" is in the libs we are referencing, see https://github.com/NuGet/NuGet.Client/blob/release-4.3.0-rtm/src/NuGet.Core/NuGet.Configuration/Settings/Settings.cs#L213-L221
We might be "doing it wrong" and there might also be an issue with the Working directory (this has changed since we no longer call nuget.exe
from within whatever directory it was previous).
if you put the nuget.config file in the folder where nuget.exe file resides, then it works again
@timschps by using a build agent that always checks out the repository the work around does not work. do you have any other ideas except adding nuget.config to the source code project?
I've noticed a related bug that is definitely in the referenced library mentioned above and not in Cake that has to do with NuGet.Config resolution. The docs here say that on Mac/Linux the default user nuget.config file could be at ~/.config/NuGet/NuGet.Config or ~/.nuget/NuGet/NuGet.Config depending on your distribution. However the library is only checking the second place. My config is at ~/.config/NuGet/NuGet.Config and isn't picked up. I added a symlink to mine from ~/.nuget/NuGet/NuGet.Config and it started working.
What You Are Seeing?
in Diagnostic log: Nuget.config not found.
What is Expected?
Nuget.config being next to build.ps1 should be used.
What version of Cake are you using?
0.25
Are you running on a 32 or 64 bit system?
windows server 2012 r2, 64bit.
What environment are you running on? Windows? Linux? Mac?
windows server 2012 r2, 64bit.
Are you running on a CI Server? If so, which one?
TFS v. 15.117.26615.0 on premise. powershell task: PowerShell on Target Machines v.1.* But the error looks like generic.
How Did You Get This To Happen? (Steps to Reproduce)
build.ps1 from here: https://raw.githubusercontent.com/cake-build/cake/develop/build.ps1
build.cake
Output Log
So even though latest (0.25 https://cakebuild.net/blog/2018/01/cake-v0.25.0-released) change in cake provided nuget client inside cake.exe, I think it should still look for nuget.config in cake.exe directory or above up to drive directory. The documentation: https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#how-settings-are-applied