ILT – How to Programmatically Get Version Information of a Visual Studio Solution


How to get major, minor, build and revision version figures for a visual studio solution (using c#)?

// Step 1: Create a <a href="">Version</a> object

Version v = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

// Step 2: Use Major, Minor, Build and Revision components in the Version object as you desire!
// e.g.

Version v = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
lbVersion.Text = string.Format("V {0}.{1}.{2}", v.Major, v.Minor, v.Build);




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: