我在我的应用程序部署中使用每次发布时自动增加修订
结合AssemblyInfo.cs
:
[assembly: AssemblyVersion( "2.0.0.*" )]
[assembly: AssemblyFileVersion( "2.0.0.0" )]
我想通过以下方式向用户显示软件的当前版本:
protected void InitializeVersionInfo()
{
Assembly a = Assembly.GetExecutingAssembly();
Version v = System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed
? System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion
: Assembly.GetExecutingAssembly().GetName().Version;
string version = String.Format( System.Globalization.CultureInfo.InvariantCulture,
@"Tool - Version {0}.{1}.{2} (r{3})", v.Major, v.Minor, v.Build, v.Revision );
VersionLabel.Text = version;
}
但我得到不同的版本号:
我做错了什么或我错过了什么?
如何让软件显示2.0.0.12
?