如何获取我的 msi 版本?
我试过这个:
private void barButtonItem_Version_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
MessageBox.Show("Version" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
}
我也尝试过:
MessageBox.Show("Version: " + System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString());
这个代码:
Assembly assembly = Assembly.GetExecutingAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion;
MessageBox.Show("Version: " + version);
这个代码:
string productVersion = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion;
MessageBox.Show("Version: " + productVersion);
和这个:
MessageBox.Show("Version: " + Application.ProductVersion);
但它们都返回 1.0.0.0,正如您在图像上看到的那样,我的版本是 1.0.0
提前谢谢你