It depends what you mean by "version". As with everything, it's not as simple as it may seem. managed assemblies have a managed version, which is what is set in your AssemblyVersion
attribute, something like this:
[assembly: AssemblyVersion("3.0.2")]
This is the version that the managed loader uses and the version that ends up in the type names of the types in the assembly. It's really the "important" version number. It's the version you get if you look at an Assembly's Version
Property.
However, it's not the version number that you see when you look at "File -> Properties" in something like Windows Explorer.
Explorer looks at the file for native VERSION_INFO headers, which are completely disconnected from the managed version. For a desktop app, it's set using the AssemblyFileVersion
attribute. The Compact Framework, however, doesn't have support for setting that version information. You can work around that if you want, but the CF also has no inherent way to read it back. That's why the blog entry you refer to is talking about - getting the native version info.
So you have to figure out which version you're interested in, then follow the path for setting and getting it. Generally speaking, if it's a managed assembly I try real hard to avoid ever dealing with the native AssemblyFileVersion
because it's really not useful for much of anything. Instead I just work with the AssemblyVersion
. This is true for CF, desktop or Mono.