The following command doesn’t work if you have more than one nuget.exe
msbuild MyWebApplication.csproj "/t:Rebuild" "/t:ResolveReferences" "/t:_CopyWebApplication" /p:Configuration=Release /p:WebProjectOutputDir=publish\ /p:OutDir=publish\bin\
The reason for this is the row
In combination with having more than one package containing a nuget.exe file. I don’t know exactly how to solve it since I’m not a msbuild expert.
Ok, so I became a msbuild expert and found a solution for you:
if you change the line
<NuGetExe Condition="'$(OctopusNuGetExePath)' == ''">@(FindNuGet)</NuGetExe>
<NuGetExe Condition="'$(OctopusNuGetExePath)' == ''">%(FindNuGet.Identity)</NuGetExe>
you will get a better solution. Basically what that line is doing is taking all the files it found and assigning it one by one to
NuGetExe which result in it having the latest value in the list.
I could make a pull request if you have the OctoPack project on github or somewhere else.