increment numbers in version.props

Viewed 1453

I have seen version.props file in some open source projects here and here.

The content is the following:

<Project>
  <PropertyGroup>
    <VersionPrefix>0.0.1</VersionPrefix>
    <VersionSuffix></VersionSuffix>
  </PropertyGroup>
</Project>

I understand this has to do with building projects and version numbers, easy.

My question is how can I increase the version numbers?

I have looked at dotnet cli tools and commands, didnt see any reference about that.

Can you pleaze give me the codez? I mean , help me understand how I can work this version.props file?

1 Answers

This file is include in each project file : <Import Project="..\version.props" /> directly or indirectly throught an other import. And version is updated by hand.

But you can also use dotnet msbuild with /p:Version={your version number}:

dotnet msbuild /t:build /p:Version=1.0.0 

Or with publish target for exemple:

dotnet msbuild /t:publish /p:Version=1.0.0 
Related