Repositorypath relative to configuration file / "$\SomePath"

Topics: General
Jul 31, 2013 at 10:14 AM

I'm trying to define a custom repository path, by having a nuget.config in the root of my (multi-solution) folder structure. I found out that I can set that repository path since 2.1 [1], in fact that is even what [2] links to in the definition of "Package Restore".

But I'd like to use a relative path, nothing absolute. I stumbled upon [3] which really just wants to explain how the config files are found and the settings applied, but that contains this gem in the sample config files used:
    Used to specify the default location to expand packages.
    See: NuGet.exe help install
    See: NuGet.exe help update
    If value starts with "$\" then location is relative to this conf file.
    <add key="repositorypath" value="$\External\Packages" />
That's awesome, exactly what I want. Only, if I try that (I use "$\Packages" in my config) it doesn't work: It uses that literally and creates a folder "$" with a subfolder "Packages".


1) Is the syntax incorrect? Is [3] lying in the sample configs?

2) Is there a way to specify a path that is relative to the config file? Is every relative path used there relative to the config file already?

Jul 31, 2013 at 12:06 PM
  1. Yup, we are lying in the sample configs. We'll fix it. The '$' syntax is not supported.
  2. Yes, you can specify relative paths without the $. Relative paths will be treated as relative to the config file already.