Incremental Build Numbers

  • Thread starter Thread starter Jonathan Dixon
  • Start date Start date
J

Jonathan Dixon

Can someone tell me how i can get the build number of an application at run
time

I have a program which is built incrementally and when it loads i want to
display the build number
as the name of the form.

Also is there a way to specify how it increments and how i can change the
starting number and how it increments

Regards

Jonathan Dixon
 
You can use this line of code:
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString
() for the full version number you can also parse out the Build, Major,
Minor and Revision values off the Version property.

It reads the value found in the AssemblyInfo.vb/.cs file. Open the
AssemblyInfo file for information on versioning...

Shannon, MCAD

http://www.clarityknows.net
 
* "Jonathan Dixon said:
Can someone tell me how i can get the build number of an application at run
time

Basic information on versioning:

<URL:http://msdn.microsoft.com/library/en-us/dndotnet/html/managevers.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnbda/html/tdlg_ch5.asp>
<URL:http://msdn.microsoft.com/library/en-us/cptutorials/html/versioning_components.asp>

Parts of the version number:

Main version
"Product" version.

Sub version
Sub version, for example Service Pack.

Build
During development, auto-increment.

Revision
Hotfix or Quick Fix Engineering (QFE).

When using auto incrementation of numbers, the build number contains the
number of days since January, 2000; the revision contains the number of
seconds since midnight divided by 2.

The version number can be changed in the file "AssemblyInfo.vb". The
version number will updated automatically when re-opening the solution.

Getting the program version number:

\\\
MsgBox( _
System.Reflection.Assembly.GetExecutingAssembly(_
).GetName().Version.ToString() _
)
///

- or -

\\\
MsgBox( _
System.Windows.Forms.Application.ProductVersion.ToString() _
)
///
 
Thanks a million, Do you know how to change the increment and how to start
it from 0

Regards

Jonathan Dixon
 
It is inside the

AssemblyInfo.cs file in your project (assuming c#

Change the line below, but this file is well commented.

[assembly: AssemblyVersion("1.0.*")

e
[assembly: AssemblyVersion("1.0.0.0")]
 
Back
Top