Getting the publish version number using VB.NET 2008

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Hentrich

    #1

    Getting the publish version number using VB.NET 2008

    Dean,

    You can retrieve the "publish version" number from the Project Settings using this:

    If (System.Deploym ent.Application .ApplicationDep loyment.IsNetwo rkDeployed) Then
    Dim verDeployed As System.Version = My.Application. Deployment.Curr entVersion
    End If
  • Peter Hentrich

    #2
    To display published or assembly version depending ondeploy method

    To display published(netwo rk deployed) or assembly version:

    ' test if network deployed
    Dim verDeployed As System.Version
    Dim strVerDeployed As String
    If (System.Deploym ent.Application .ApplicationDep loyment.IsNetwo rkDeployed) Then
    verdeployed = My.Application. Deployment.Curr entVersion
    strVerDeployed = verDeployed.ToS tring
    Else ' or if command line execution
    Dim asmThis As System.Reflecti on.Assembly = System.Reflecti on.Assembly.Loa d("CADView")
    Dim asnThis As System.Reflecti on.AssemblyName = asmThis.GetName ()
    verDeployed = asnThis.Version
    strVerDeployed = verDeployed.ToS tring
    End If
    Me.Text = My.Settings.Com panyName & " " & My.Settings.Win dowTitle & " v." & strVerDeployed

    Comment

    Working...