ASPNET Pre-compilation fails: Nuget auto restore not working via TFS build?
For some reason, when a build is called through the metaproj file as Fortify requires, the auto download of nugget packages do not work properly.
I have one .NET project within my solution that is using a newer version of Microsoft.AspNet.Webpages (3.2.3) whereas the others are using 3.2.2 but Nuget is unable to pull down the updated package during build time. All other build definitions with the same source code without the FortifyClient tasks seem to function properly without an issue.
sourceanalyzer -b Project1 -64 -Xmx36G -debug -verbose -logfile "d:\TFS\Builds\Agent1\Project1\DevBuild-Fortify\Sources\Project1\Dev\Solutions\Master\Project1.trans.log" -libdirs "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5" "D:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" "d:\TFS\Builds\Agent1\Project1\DevBuild-Fortify\Sources\Project1\Dev\Solutions\Master\Master.sln" /REBUILD Debug
Running: ASPCOMPILE : "-v" "/Project1" "-p" "D:\tfs\Builds\Agent1\Project1\De
vBuild-Fortify\Sources\Project1\Dev\Test\Project1.Payment.Web\\" "-d" "-f" "-
c" "-fixednames" "C:\Users\User1\AppData\Local\Fortify\VS-14.0-16.1
Translation completed with the following errors:
ASP Precompilation failed
aspnet_compiler: error ASPCONFIG: Could not load file or assembly 'System.Web.Helpers, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31bf3856ad364e3
5' or one of its dependencies. The located assembly's manifest definition does n
ot match the assembly reference. (Exception from HRESULT: 0x80131040)
Any help would be much appreciated, thanks!
This is not a Fortify problem; the issue is that devenv.exe builds do not restore nuget packages. Download the command-line nuget.exe on your build agent, and before calling sourceanalyzer, call this command line: `nuget.exe restore Master.sln`.