It is more possible with .NET than, perhaps, with anything else. Look at your "AssemblyInfo.cs". It usually has the attribute applied on the assembly level:
[assembly: AssemblyVersion("1.2.3.4")]
You can always write this attribute, modify it according to your versioning policy, etc.
The attribute type uses is
System.Reflection.AssemblyVersionAttribute
. Please see:
http://msdn.microsoft.com/en-us/library/system.reflection.assemblyversionattribute.aspx[
^].
Due to limitation of the attributes, it has a string property
Version
, but you can also parse it as a class
System.Version
:
http://msdn.microsoft.com/en-us/library/system.version.aspx[
^].
This type has everything you may need for version management: semantic comparison is defined, it can be serialized/deserialized, converted to string and parsed from string (which you need for using the
AssemblyVersionAttribute
. You can use
System.Reflection.Assembly.GetCustomAttributes
to check if this attribute defined for any given assembly, if it is, extract the version string and parse as the
Version
instance. Please see:
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getcustomattributes.aspx[
^].
That's all you need.
Good luck,
—SA