Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publish Version vs Assembly (etc) Versions

I've read threads here about the Assembly, File and Assembly Informational versions.

I'd like to know where the Publish version fits in. The result of...

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

...appears to be the AssemblyVersion. Up until now I've been using the publish version with the deployment class:

ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment;
Version thisAppsVersion = deployment.CurrentVersion;

...but this isn't available unless the app is installed. I like how it has the option to automatically increment the Revision.

Is there a way to get the publish version without being network deployed? Should it be the 'public face' of the app's version?

Example: UI Version (twisted from Publish Version)

Thanks in advance!

Gregg

like image 404
MrGreggles Avatar asked Jan 20 '10 04:01

MrGreggles


1 Answers

I think the different versions serve different purpose.

1) AssemblyVersion is for CLR to load and bind assemblies. This is useful for developers but not end-users.

2) FileVersion or AssemblyFileVersion is what Windows displayed as the executable's file version. It is just the same Win32 application's version. And this version is used by the system and installers to determine which version is newer.

3) PublishVersion is used to version the deployment package. It is OK to have the same binaries published twice with different publish versions.

4) The version you show to your end-users is yet another version. Call it product version or something else. It may different from any of the above, for e.g. business purpose. See AssemblyInformationalVersionAttribute if you want to use some .NET built-in support.

For simple cases, you may use the FileVersion as the product version. But publish version is not a good idea to me.

like image 86
Dudu Avatar answered Oct 02 '22 18:10

Dudu