I'm working on a NuGet package that adds a step to the build process by using a .targets
file.
I need to reference other files from my NuGet package in order to complete the build successfully.
In the past, I've used $(SolutionDir)packages\MyPackage
and all has worked fine.
However, I was just playing around with the VS 2017 RC, and I noticed that my package was installed in the global NuGet package directory, not in the solution folder.
Is there some macro that I can use from MSBuild, that contains the path for the NuGet packages
folder? It is a requirement that I maintain compatibility with VS2012.
msbuild -t:Restore will restore nuget packages for projects with PackageReference nuget management format.
The global-packages folder is where NuGet installs any downloaded package.
The location of the default global packages folder. The default is %userprofile%\. nuget\packages (Windows) or ~/. nuget/packages (Mac/Linux).
The $(NuGetPackageRoot)
macro points to the package root.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With