Search code examples
vb.netazure-devopsnuspecazure-artifacts

How to generate a *.NUSPEC file during a VSTS build?


Currently the NuGet Packager VSTS Build Step seems to not support *.VBPROJ files, so it looks like the only alternative will be to use *.NUSPEC files.

However, I'm unfamiliar with how to automatically create a *.NUSPEC file on the server at build time.

Is this a problem that other VB developers have solved somehow?


Solution

  • In fact, you can use vbproj file to generate nuget package with "NuGet Packager" task, it can work:

    enter image description here

    And for your question, the nuspec file can be generated from the vbproj file or dll file of your build output by run "nuget spec" command, so you can add a "Command Line" task in your build definition to call nuget command to do this as following: enter image description here You can also change "spec" to "pack" to generate nuget package file from the command directly. Refer to this link for details: Creating and Publishing a Package.