Version control

Hi, when I build and publish a VB.net 2005 program, the version number is incremented automatically - is this held in a variable anywhere that I can use to display within my application

Answer this question

Version control

  • Christian Sparre

    try this

    Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString()

  • vito1281

    CodeButcher wrote:
    have you change the version number stored in the assembly file

    Ah! No I hadn't - so I see how to do that now.

    However, I am more interested in getting to the publish version - then I can match up exactly which version of my distributed file my users have, without having to update the assembly version and match it to publish version. Isn't there any way to get a "publishversion" variable


  • Tamim Sadikali

    Try this:

    Dim theFileVersion As FileVersionInfo

    theFileVersion = FileVersionInfo.GetVersionInfo(filepathandname)


  • KissPsycho

    Perhaps you are looking for

    Application.ProductVersion

    Hope this helps.


  • fripper

    have you change the version number stored in the assembly file
  • Zooz

    MarcD wrote:
    Perhaps you are looking for

    Application.ProductVersion

    Hope this helps.

    Thanks but afraid not. It's the publish version I need. This is currently at 8.0.0.3, application.productversion returns 1.0.0.0


  • manasi

    Check out the following

    My.Application.Deployment Namespace
    http://msdn2.microsoft.com/en-gb/library/dzt1y5bx.aspx

    More specifically the currentversion property which will give you the clickonce publish version number


  • Version control