Andrew Andrew - 11 months ago 65
C# Question

Version number in Winform form text

How can I insert the assembly version number (which I set to auto increment) into a Winform form text?

Answer Source

Either of these will work:

var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 
this.Text = String.Format("My Application Version {0}", version);

string version = Application.ProductVersion; 
this.Text = String.Format("My Application Version {0}", version);

Assuming this is run on the Form you wish to display the text on