I am a very new programmer....
I have an About Box that I generated using a Windows Forms Template. Our build system for the product updates the AssemblyFile Version attribute in the GlobalAssemblyInfo.cs file. I have been to many sites and have found the code to properly update the Details in the .exe Properties file to correctly display the product version, however, I have been unsuccessful at getting the version in the about box to display the same (and correct) version that the properties window is displaying.
My about box code is:
partial class AboutBox1 : Form
{
public AboutBox1()
{
InitializeComponent();
this.Text = String.Format("About {0}", AssemblyTitle);
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
this.labelCopyright.Text = AssemblyCopyright;
this.labelCompanyName.Text = AssemblyCompany;
this.textBoxDescription.Text = AssemblyDescription;
}
public string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
And my GlobalAssemblyInfo.cs file is:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Global settings
[assembly: AssemblyConfiguration("RELEASE")]
[assembly: AssemblyCompany("xxxx")]
[assembly: AssemblyProduct("xxxx")]
[assembly: AssemblyCopyright("xxxx.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("2.0.*")]
[assembly: AssemblyFileVersion("2.0.*")]
I have made sure that the AssemblyInfo.cs file does not contain any of the information that is in GlobalAssemblyInfo.cs.
I have tried changing the AboutBox1.cs file to have AssemblyFileVersion instead of AssemblyVersion but that didn't work.
What am I missing?