NuGet with TeamCity for project shared by 2 solutions - .h file not found

104 Views Asked by At

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?

1

There are 1 best solutions below

1
On
#include <cpprest/json.h>

probably has to be something like

<../packages/casablancaapi/native/lib/cpprest/json.h>