[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4496
  • Last Modified:

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
0
finance_teacher
Asked:
finance_teacher
3 Solutions
 
lenordisteCommented:
here is how to get the publish verison:
//
using  System.Deployment.Application;
//
if (ApplicationDeployment.IsNetworkDeployed) {
var appDeploy= ApplicationDeployment.CurrentDeployment;
var version = appDeploy.CurrentVersion;
}
0
 
PlatoConsultantCommented:
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
 
bhagwantsinghCommented:
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now