Duplication of nuget.exe in .\octopack

In the nuget package installation powershell script or the targets file itself please support a case when .nuget\nuget.exe is already checked-in (to support auto-restore) so duplicated nuget.exe won’t be added and used.

Or is there a way to override nuget.exe path in either targets or TeamCity build settings?


You can delete the .octopack\nuget.exe and instead pass /p:OctoPackNuGetExePath=<path>\nuget.exe whenever OctoPack is used.


I sett an additional parameters in TeamCity build step:


but still getting an error:

[CreateOctoPackPackage] error OCT-1676060969: Error when attempting to execute C:\TeamCity\buildAgent\work\403d3ec57312a972\.octopack\NuGet.exe: The system cannot find the file specified

Why was it ignored? Should I specify it in other place. As far I as I know - no, that’s the correct place.

I can reproduce the issue by runnin msbuild manually:

msbuild MyProject.sln /m /t:Build /p:OctoPackNuGetExePath=".nuget\nuget.exe" /m  /p:RunOctoPack=true

Specifying full path to nuget.exe solved the problem. But this is doubtfully possible on a build server.
Any workaround please?

Debugging msbuild shows that ..\.nuget\nuget.exe should be used instead because current directory turns out to be not a solution root but project folder.