0

So, I've been wrestling with this issue so perhaps somebody can shed some light. I'm creating a .Net library and it's going to pull in another library via NuGet. I've learned there are three patterns for specifying the Nuget dependencies depending on the version of stuff: packages.config, project.json and Package References in the csproj file. We're using VS2015, so the last one is not an option. I'm thinking I should go with project.json, but having issues building the library on the Jenkins server.

So, if I use packages.config I can get everything to work. On my Jenkins server I issue a "nuget restore" and it pulls all the packages into the packages folder.

If I use project.json (which support the wildcard syntax I'd like to use), the "nuget restore" pulls down the package and places it into a cache. When msbuild runs, it can't find the libraries that nuget just pulled down. When running inside of VisualStudio, there is a target for ResolveNuGetPackageAssets that get run, but I can't see it being run with the msbuild process.

Any thoughts on the right way to build project with msbuild when they reference nuget packages with project.json?

Thanks in advance for any help you can offer.

  • 1
    Stop and use VS2017. `project.json` has been long dead, so let it rest in peace. – Lex Li Sep 04 '17 at 00:39
  • This can be done as long as the VS installation has all the needed bits installed but the feature is deprecated and about to be removed for good once all project types (e.g. UWP) move away from project.json – Martin Ullrich Sep 04 '17 at 08:07
  • Have you ever check the path of those libraries in the References are correct on your build server? Since you could restore those packages successfully, one possible is that the path of libraries are incorrect. – Leo Liu Sep 04 '17 at 09:43

0 Answers0