1

I have a VSTS build definition that creates a NuGet package of the component the build creates. When I try using the NuGet Publish task (available out of the box) in the build definition to publish to a UNC path, it succeeds but the .nupkg just ends up in the root of the UNC path (instead of the nested folder structure with the .sha512 and nuspec files that help indexing).

It appears that the NuGet Publish task is doing a push, which works nicely for http endpoints, but for UNC endpoints a NuGet add command is needed instead. Is there a way to coerce the NuGet Publish task to my needs?

If all else fails I'll powershell it, but I'm hoping there is support for UNC that I'm not finding. enter image description here

Sean B
  • 11,189
  • 3
  • 27
  • 40

2 Answers2

1

You need to use nuget add command:

  1. Add Command Line build step (I put the nuget.exe in the build server: C:\Tools\nuget.exe)

enter image description here

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
  • Thanks for the head start on the powershell. I'm hoping there is a way to do it with the NuGet Publisher build step else I will fall back to what you have. – Sean B Feb 17 '17 at 16:16
  • 1
    @SeanB You can built a build extension, then you can use it as other build step/task. https://www.visualstudio.com/en-us/docs/integrate/extensions/develop/add-build-task – starian chen-MSFT Feb 20 '17 at 01:29
1

I was able to publish packages to UNC path with Nuget Publisher(out-of-the-box) task by manually modifying the ps1 script. Also i tried to use a variable to define my UNC path. Find the screen shot for changes in ps1.

enter image description here

Once edited I have not yet got a chance to publish packages to nuget server yet. I think you wont be able to publish it to server with the above changes made.

Hope this helps.

Sam
  • 279
  • 3
  • 9