Previous answers to this question refer to editing the AssembyInfo.cs file to set the Assembly Version. I am generating a NuGet package using the new leaner .Net Core format of .csproj file for .Net Framework 4.6.1, and there is no AssemblyInfo.cs (or it's auto-generated and deleted).
If I try to set the Package Version property to 1.0.2.* in the project properties in VS2019, I get a popup error:
If possible, how can I get the revision number to auto-increment, ideally so on each build the number is incremented (1.0.2.45 => 1.0.2.46) and the number is retained across releases (1.0.2.46 => 1.0.3.47, manually editing the build/release number).
Note: I've already looked at the answer here, here and here and they all refer to the AssemblyVersion attribute. I want to update the Package Version (which is simply the Version in the CSProj file).
Update: One of the answers suggested a couple of GIT versions tools. I forgot to mention that TFS is used for a lot of the projects I want to use this on; these are work projects shared with other team members and are well established so could not easily be migrated to GIT without a lot of discussion even if it didn't get a simple veto by management as an unnecessary change.