Quick Tip : Display the file version of your application in C#

Quick Tip : Display the file version of your application in C#

To be able to display the version of your application can be very helpful, especially if you do support on the product and you need to find out what version the user is running.

Version numbers typically display as major number.minor number.build number.private part number

By using Application.ProductVersion you can quickly display the file version of the assembly.


private void PrintProductVersion() {
textBox1.Text = "The product version is: " +
Application.ProductVersion;
}

 

How to set the file version of your application

Right click on the project

Click on the Assembly Information…

Assembly info

 

 

File Version

 

Set the File Version

 

More about software versioning:

https://en.wikipedia.org/wiki/Software_versioning

https://msdn.microsoft.com/en-us/library/system.windows.forms.application.productversion(v=vs.110).aspx

Email Newsletter

Missing out on the latest Cupofdev.com developments? Enter your email below to receive future announcements direct to your inbox. An email confirmation will be sent before you will start receiving notifications - please check your spam folder if you don't receive this.