0
votes

By default, the NuGet Installer build step seems to restore packages in a "packages" folder next to wherever the specified solution file resides. However, in our case, we have a few projects that are shared across multiple solutions and would like to be able to specify a restore location that is higher up in the filesystem. When working locally, we're able to use a configuration such as the following in a NuGet.config file to set a package location that can be used by multiple solutions:

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

Note the "repositoryPath" key that allows us to set the package location further up the folder hierarchy. Is there any way to achieve this same result with TeamCity's NuGet Installer build step?

2
Came across a bug report that seems to indicate that the configuration we're using above should work for specifying the location. Hopefully will be available in the next release. youtrack.jetbrains.com/issue/TW-35130carmbrester

2 Answers

0
votes

We do NuGet package restore and TeamCity, but TeamCity knows nothing about our restore process. The package restore is simply a target in our MSBuild xml, as detailed in this walkthrough. Our build step depends on the restore step, so it gets executed seamlessly. This should give you the flexibility to put the packages where they need to be.

0
votes

Sure there is, you can provide the location in the Command line parameters:

-PackagesDirectory "%system.teamcity.build.checkoutDir%\nuget.packages"