C# -- About Box -- display "Publish Version"

Below displays "AssemblyVersion"
which is found in
  1. Application TAB
  2. Assembly Information BUTTON
         ** attached 1.jpg
--------------------------------------------------
        public string AssemblyVersion
        {
            get
            {
                return Assembly.GetExecutingAssembly().GetName().Version.ToString();
            }
        }
--------------------------------------------------
How can I get the "Publish Version"
which is found in below so it displays
when users hit my "About" button ?
  1. Publish TAB
  2. Publish Version
         ** attached 2.jpg
1.jpg
2.jpg
finance_teacherAsked:
Who is Participating?
 
lenordisteConnect With a Mentor Commented:
here is how to get the publish verison:
//
using  System.Deployment.Application;
//
if (ApplicationDeployment.IsNetworkDeployed) {
var appDeploy= ApplicationDeployment.CurrentDeployment;
var version = appDeploy.CurrentVersion;
}
0
 
PlatoConsultantConnect With a Mentor Commented:
If you mean ClickOnce publish version:

if (System.Deployment.Application.ApplicationDeployme nt.IsNetworkDeployed) {
System.Deployment.Application.ApplicationDeploymen t ad =
System.Deployment.Application.ApplicationDeploymen t.CurrentDeployment;
version = ad.CurrentVersion;

}
0
 
bhagwantsinghConnect With a Mentor Commented:
This will give you publish version

C#

Application.ProductVersion;

or

VB.NET

Application.ProductVersion

Open in new window

0
 
finance_teacherAuthor Commented:
Below works
System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion);
-----------------------------------------------------------------------------------------------------------------
        public About()
        {
            InitializeComponent();
            this.Text = String.Format("About {0}", AssemblyTitle);
            this.labelProductName.Text = AssemblyProduct;
            this.labelVersion.Text = String.Format("Version {0}", System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion);
            this.labelCopyright.Text = AssemblyCopyright;
            this.labelCompanyName.Text = AssemblyCompany;
            this.textBoxDescription.Text = AssemblyDescription;
        }
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.