Share via


Unable to locate Nuget on a Hosted Build

I was working for a customer as they were having an issue after importing their code into Visual Studio Online hosted build. The build error they received was

Application\Codebase\.nuget\NuGet.targets(83,9): Error : Unable to locate 'C:\a\3eb8c622\Customer\Application\Codebase\.nuget\NuGet.exe'

The real reason for this is that when you import code into Team Foundation Server it doesn’t check in .exe’s by default, this means nuget.exe is not in your repository. You can actually fix this by adding the DownloadNuGetExe variable to your build and setting it to True.

DownloadNuGetExe