At the moment I am manually updating the version field (textbox) in my application every time I publish it. I am wondering if there is a way to have my applicat
If you get an error of ApplicationDeployment, then you can try this:
For global version accessing through Program, declare inside Program class:
private static Version version = new Version(Application.ProductVersion);
public static Version Version
{
get
{
return version;
}
}
Now you have Program.Version anywhere available in the program and you can use it to get version information like this:
LabelVersion.Text = String.Format("Version {0}.{1}",
Program.Version.Major.ToString(),
Program.Version.Minor.ToString());