How to set and get the Version of my Application (.exe) [C#]

Shaitan00

Junior Contributor
Joined
Aug 11, 2003
Messages
358
Location
Hell
Simple enough question - how do I set and get the VERSION of my application? So that I see it when I right-click on my file->properties->version.
Unless I am blind - in the good old days it was simply in the Project->Properties->Version and we could set the Major and Minor Version, I assume C# has something similar and hopefully more sofisticated?

At the same time I need a way to GET that version in-code
Any help/hints would be appreciated, thanks
 
You should be able to assign a version to yuor application through the assemblyinfo.cs file that is part of the project, or if you are not using VS then search MSDN for the AssemblyVersion attribute.

You can get a string representation of the version number by calling Application.ProductVersion or a more detailed bit of information by calling
Visual Basic:
System.Reflection.Assembly.GetExecutingAssembly().GetName.Version
 
Back
Top