How can I get the build number of a Visual Studio project to increase?

Why doesn't creating a project in Visual Studio increase the build number?

I have this in AssemblyInfo.cs:

[assembly: AssemblyVersion("1.5.*")]

... and this is in the frmAbout constructor:

Version versionInfo = Assembly.GetExecutingAssembly().GetName().Version;
String versionStr = String.Format("{0}.{1}.{2}.{3}", versionInfo.Major.ToString(), versionInfo.Minor.ToString(), versionInfo.Build.ToString(), versionInfo.Revision.ToString());
lblVersion.Text = String.Format("Version {0}", versionStr);

However, after making changes to the code and creating the project (right-click project name> Build), the Build part of version version does not increase. The label in the "About" field comes from:

Version 1.5.5465.25383

... at:

Version 1.5.5465.25999

Why has the build number not increased from 5465 to 5466? And why does Revision jump to 616 recesses? Is this last just a random value or the number of bytes that were changed in the source, or what?

So how can I get the build number for the actual increase?

UPDATE

Yes, razcor is right, as it shows “5465” (today, YMWV any day after that):

DateTime startDate = new DateTime(2000, 1, 1);
DateTime todaysDate = DateTime.Today;
int diffDays = (todaysDate.Date - startDate.Date).Days;
MessageBox.Show(diffDays.ToString());

, (, 5465), :

DateTime computedDate = startDate.AddDays(diffDays);
MessageBox.Show(computedDate.ToLongDateString()); // shows today date (such as what it is today, namely: "Thursday, December 18, 2014")
+4
1

'0' '*', , , ( ) . : - 1.1.2000, - , 2.

+2

Source: https://habr.com/ru/post/1568232/


All Articles