VS 2012 Solution Build now fails

Topics: General
Apr 21, 2014 at 4:24 PM
Edited Apr 21, 2014 at 6:51 PM

My laptop blue screened and I had to recover my profile. Since this occurred I have been unable to successfully build any solution where NuGet is configured for it. It appears that the NuGet restore is properly restoring the packages however the restore command is returning -1 and VS is treating it as a build failure thus preventing the actual project build(s) from proceeding.

Here is a snip it of what is happening with the logging set to Detailed:
1>Target "RestorePackages" in file "[Full Solution Path].nuget\NuGet.targets" from project "[Full Solution Path]\MyProject\MyProject.csproj" (target "Build" depends on it):
1>Task "Exec" skipped, due to false condition; ('$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')) was evaluated as ('Windows_NT' != 'Windows_NT' And Exists('[Full Solution Path]\MyProject\packages.config')).
1>Using "Exec" task from assembly "Microsoft.Build.Tasks.v4.0, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>Task "Exec"
1> "[Full Solution Path].nuget\NuGet.exe" install "[Full Solution Path]\MyProject\packages.config" -source "" -NonInteractive -RequireConsent -solutionDir "[Full Solution Path]\ "
1>[Full Solution Path].nuget\NuGet.targets(100,9): error : 2014-04-21 09:56:09 [00000154] info [native] Agent has no active settings - running normally
1> Restoring NuGet packages...
1> To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
1> All packages listed in packages.config are already installed.
1>[Full Solution Path].nuget\NuGet.targets(100,9): error MSB3073: The command ""[Full Solution Path].nuget\NuGet.exe" install "[Full Solution Path]\MyProject\packages.config" -source "" -NonInteractive -RequireConsent -solutionDir "[Full Solution Path]\ "" exited with code -1.
1>Done executing task "Exec" -- FAILED.
1>Done building target "RestorePackages" in project "MyProject.csproj" -- FAILED.
1>Build FAILED.

I've removed and re-installed VS 2012, removed and re-installed NuGet, set VS options not to automatically check for missing packages and unchecked the Allow NuGet to download missing pacakges, all to no avail. Any help would be appreciated.

Almost forgot, the NuGet.exe version information is:
Product Version: 2.8.1
File Version: 2.8.50320.36


Apr 23, 2014 at 4:14 PM
It is probably a PowerShell issue, see http://stackoverflow.com/questions/15555272/powershell-scripts-are-not-running.

As a temporary work around (hack) set line 101 to: