Search code examples
c#visual-studio.net-corevisual-studio-2017.net-standard

Auto Versioning in Visual Studio 2017 (.NET Core)


I have spent the better part of a few hours trying to find a way to auto-increment versions in a .NETCoreApp 1.1 (Visual Studio 2017).

I know the the AssemblyInfo.cs is being created dynamically in the folder: obj/Debug/netcoreapp1.1/

It does not accept the old method of: [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.*")]

If I set the project to package I can set versions there but this seems to be used to build the AssemblyInfo.cs file.

My question is, has anyone figured out how to control version in .NET Core (or .NETStandard for that matter) projects.


Solution

  • I have been looking for a version incrementer for a .NET Core app in VS2017 using the csproj configuration format.

    I found a project called dotnet bump that worked for the project.json format but struggled to find a solution for the .csproj format. The writer of dotnet bump actually came up with the solution for the .csproj format and it is called MSBump.

    There is a project on GitHub for it at:

    https://github.com/BalassaMarton/MSBump

    where you can see the code and it's available on NuGet too. Just search for MSBump on Nuget.