We have a complex solution (22 sub-projects, one of which is a website) that won't build using TFS Build. If I open the solution on the build server the code compiles fine inside of Visual Studio, but if I open a CMD prompt and try MSBUILD piccsserver.sln I get this error:
"C:\TFS2017_agent\_work\4\s\CorePlatform\PICCS\Main\src\piccsserver.sln"
(default target) (1) ->
"C:\TFS2017_agent\_work\4\s\CorePlatform\PICCS\Main\src\PICCS_WebHost.metaproj"
(default target) (24) ->(Build target) -> ASPNETCOMPILER : error ASPCONFIG: Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not mat
ch the assembly reference. (Exception from HRESULT: 0x80131040) [C:\TFS2017_age
nt\_work\4\s\CorePlatform\PICCS\Main\src\PICCS_WebHost.metaproj]
I notice that when I build from within VS and look at the version of NewtonSoft.Json.dll in the website's bin folder, the version is 11.0.1 which is what I expect, but when I build from the command prompt the version is 4.5.11.15520.
What the heck is going on here? Doesn't building from within VS use MSBUILD?