4

I am using Team City to build a ASP.NET Core (target .NET) project. Dependency packages are deployed to the build server along with the project following this folder structure:

  • Packages
  • SolutionName
    • src
      • myproj.xproj

I have a nuget.config file with <add key="globalPackagesFolder" value="..\..\packages"/>

This corectly restores packages in VS and references seem to hold on build. However, on the build server, dotnet build doesn't find the dependencies.

Error NU1001: The dependency ... could not be resolved

Is there any way to specify the relative path of dependencies for dotnet build?

linktoemi
  • 397
  • 3
  • 10
  • Slightly different approach -- how about running your own local nuget repository? – Ignas Dec 22 '16 at 10:03
  • do you restore packages on the build server before trying to build them? – Pawel Jan 03 '17 at 04:49
  • All packages are copied over to the build server before the build. The problem is in configuring the reference path for the .xproj – linktoemi Jan 03 '17 at 09:10
  • 1
    Did you try this? http://stackoverflow.com/questions/36040678/nuget-configuration-in-asp-net-core-1-0/36041287 – Axel Heer Jan 03 '17 at 22:41

1 Answers1

0

Based on Axel's comment and Nuget Configuration in ASP.NET Core 1.0

Added a global.json file in the src folder with content:

{ "packages": "../../Packages" }
Community
  • 1
  • 1
linktoemi
  • 397
  • 3
  • 10