Absent Member.
Absent Member.

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=, 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!

Labels (1)
Tags (3)
1 Reply
Lieutenant Lieutenant

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`.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.