.net 设置版本号信息

1、AssemblyInfo.cs

[assembly: AssemblyVersion("1.3.170116")]
[assembly: AssemblyFileVersion("1.0.0.2")]
[assembly: AssemblyInformationalVersionAttribute("1.3.170116")]

2、

// 版本号

1、
string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

2、

Assembly m_AppAssembly = Assembly.GetEntryAssembly();
object[] attributes = m_AppAssembly.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false);
this.Title = String.Format("登录 {0}",((AssemblyInformationalVersionAttribute)attributes[0]).InformationalVersion);

原文地址:https://www.cnblogs.com/sshoub/p/6288545.html