Version Control

Hello,

Probably you will need or already need some version controlling on your software or on its modules.
This is made through the VS_VERSION_INFO resource inside C++ projects and through AssemblyInfo.cs file inside C# projects.

I have found an old but up to date tool (runs from VS2002 to VS2008) which allows you to easily manage these version informations. This tool, from Julijan Sribar, is an AddIn which tracks all opened projects and allow you to manage each version information. This tool is provided for free and its source code is also available for download: Versioning Controlled Build

Another issue is how to get this information at runtime to display, for instance, this version at an “About” like dialog inside your product. To do that in VC++ we need to read the VS_VERSION_INFO resource and get what we want. There is also another great article Retrieving version information from your local application’s resource, from luetz,explaining how to do that.

Through C# there is no big deal, you can read the version information from AssemblyInfo as follows:

System.Reflection.Assembly oAssembly = System.Reflection.Assembly.GetExecutingAssembly();
System.Diagnostics.FileVersionInfo oFileVersionInfo = FileVersionInfo.GetVersionInfo(oAssembly.Location) ;
MessageBox.Show(“Version Info”, oFileVersionInfo.ProductVersion);

Hope this help you to keep your file versions organized and updated!
Cheers!

Go to Source