0

The NuGet.Config, .csproj and .nuspec are in the same folder (project folder). This is my NuGet.Config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="repositoryPath" value="..\packages" />
  </config>
</configuration>

When I type nuget pack in powershell in the project folder, the .nupkg file is created in the same folder, not in the ..\packages folder.

Versions: NuGet Version: 4.1.0.2450, Visual Studio 2015

I've googled for hours and still no luck for a working solution.

Tried this one still not work: nuget.config is ignored, specifically the repositoryPath

LazNiko
  • 2,083
  • 3
  • 25
  • 39
  • 1
    This configuration is not for packing nuget packages , but for consuming them. With this configuration you add an additional source where to find packages. You can specify output path, but check the command line reference for the exact parameter. – Styxxy Jul 21 '17 at 18:12
  • Thanks! That's why. Is there no way to set the default output folder for my packages? – LazNiko Jul 21 '17 at 18:32
  • If you type in `nuget help pack` you will see the options it takes. One of them is `-OutputDirectory` which will be the directory used when the .nupkg file is generated. – Matt Ward Jul 22 '17 at 12:02
  • Thanks and actually I mean to set a default output folder for all packages so that I don't need to specify -OutputDirectory every time. That's why I researched NuGet.Config at the beginning. – LazNiko Jul 22 '17 at 13:48

0 Answers0