Dec 22, 2009

How To Read Assembly Version using code in C#

It may happen at times that you need to read version of your current project. Here's how you can do it:

string fullVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

The above code will return your version in string like "1.0.0.0". Using the .Version property, you can retrieve major , minor etc... other version properties as per requirement.

No comments:

Post a Comment