4
votes

I'm trying to figure out how to pack/publish a .Net Standard 1.4 class library project to a VSTS private nuget feed.

  • Code repo is GIT. Located in VSTS. (I acutally have a few GIT repo's under a single project in VSTS)
  • Repo has 2x csprojs. 1x .Net Stanard 1.4 class library. Other one is an xunit .net core project.
  • Need to create the nuget package.
  • Need to then publish it to the private nuget feed as part of this VSTS project.
  • For version numbers, right now I don't really care. Auto incremement based on some/any number (i'm used to using AppVeyor which has it's own remembered build number).

Has anyone done this before? Can someone show a screen shot of their build steps and/or hints/links to how to do this please?

1

1 Answers

4
votes

You can create a VSTS build definition with below four tasks to pack and publish your .net standard library project to your VSTS feed:

.NET Core task

Command: restore

Project(s): path for your .net standard library project, such as

project/dotnetStandard/ dotnetStandard.csproj

.NET Core task

Command: build

Project(s): path for your .net standard library project

.NET Core task

Command: pack

Project(s): path for your .net standard library project

Arguments:

/p:PackageVersion=1.0.0 --output $(Build.ArtifactStagingDirectory)

Commands: push

Path to NuGet package(s) to publish: $(Build.ArtifactStagingDirectory)/*.nupkg

Target feed location: select This account/collection

Target feed: select the VSTS feed you want to publish