This project has moved. For the latest updates, please go here.


Make nuget-deploy optional


I build the katanaproject from a VS 2013 command prompt using:
    set Platform=AnyCPU
    set DevDivCodeAnalysisRunType=Disabled
    call build.cmd release deploy > build.txt 2>&1


The last step of the build process fails, uploading to NuGet. This is obvious, because I have no rights to publish katana packages.

So I modified build\Sakefile.shade to
But this still results in an error:
info: Target nuget-deploy
info: Exec
info:   program: .nuget/NuGet.exe
info:   commandline: push "artifacts\Microsoft.Owin.3.0.1.nupkg"
info:   workingdir: c:\TFS\AgpWebEngine\Dependencies\KatanaProject-24aa43641ada
WARNING: No API Key was provided and no API Key could be found for the NuGet gallery ( To save an API Key for a source use the 'setApiKey' command.
Pushing Microsoft.Owin 3.0.1 to the NuGet gallery (
Please provide credentials for:
UserName: Cannot prompt for input in non-interactive mode.
warn: Exit code 1 from .nuget/NuGet.exe


I modified build\Sakefile.shade to not upload if the NUGET_DEPLOY variable is empty
#nuget-deploy target='deploy' description='Upload NuGet packages to gallery'
  test if='!String.IsNullOrEmpty(NUGET_DEPLOY)'
    var extra=''
    set extra='${extra} -Source ${NUGET_DEPLOY}' if='!string.IsNullOrEmpty(NUGET_DEPLOY)'
    nuget-push each='var nupkgFile in Files.Include(Path.Combine(TARGET_DIR, "*.nupkg"))'

Build output after modification

After modification the build ends correctly, skipping the NuGet upload
info: Target integration-test
info: Target post-integration-test
info: Target verify
info: Target nuget-deploy
info: Target deploy

file attachments

Closed Mar 2 at 10:50 PM by mgirgin


MircoBabin wrote Aug 14, 2015 at 1:06 PM

I have attached a patch with my modifications. I'm not very familiair with Git so I don't know if this is the desired format for receiving contributions.