Increment Nuget Package Version NetStandard Local Folder visual studio 2017

Viewed 706

I have a bunch of utilities that I have created for internal use, using Net Standard.

Under Project Properties->Package I have set "Generate Nuget Packages on build" .csproj, in which I have added:

<PropertyGroup>
<PackageOutputPath>MyDirPath</PackageOutputPath>
</PropertyGroup>

This all works well and good, and it creates MyInternalPackage.1.0.0.nupkg in the correct folder.

I want to know how I can auto increment the version number, when I build/rebuild my Net Standard Project.

Over to you.

1 Answers

You can add a property called AppxAutoIncrementPackageRevision and set the value to True:

Full code is below:

<PropertyGroup>
    <PackageOutputPath>MyDirPath</PackageOutputPath>
    <AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
</PropertyGroup>

Once you build, this will auto increment.

Related