0

The environment before NuGet (simplified):

  • One project shared by 2 solutions (sol1 and sol2).
  • both solutions are successfully build by TeamCity.

Adding NuGet

  • In sol1 I added a package to the project (Casablanca's C++ REST API).
  • In one of the .c file in the project I added #include <cpprest/json.h>.
  • In both solutions if have enabled NuGet package restoration.

Result

  • Locally both solutions are still successfully build.
  • Sol1 is build successfully on the TeamCity as well.
  • Sol2 failed to build on the TeamCity given an error that the cpprest/json.h file can't be found when trying to compile the .c file.
  • Note: during the build of sol2 on the TeamCity I see that the package is successfully downloaded and installed.

What can cause Sol2 to be unable to find the included json.h file?

Roee Gavirel
  • 18,955
  • 12
  • 67
  • 94
  • At a guess it might be the Sol2 file is sitting in a different relative location to the Sol1 file with respect to the project. Where does the project file expect the cpprest/json.h file to be? – SteveChapman May 28 '14 at 20:24
  • My point being that NuGet by default creates the nuget package install dir in the solution file directory – SteveChapman May 28 '14 at 20:25

1 Answers1

1
#include <cpprest/json.h>

probably has to be something like

<../packages/casablancaapi/native/lib/cpprest/json.h>
MPelletier
  • 16,256
  • 15
  • 86
  • 137
skalinkin
  • 1,024
  • 9
  • 19