开发者

Publish Version vs Assembly (etc) Versions

开发者 https://www.devze.com 2022-12-17 02:33 出处:网络
I\'ve read threads here about the Assembly, File and Assembly Informational 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消