Assign deployment version number to a variable

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

    Assign deployment version number to a variable

    In my project, I want to display the version number on the splash screen and
    in the help section of my application. I have a variable I created called
    appVersion. When I go to my deployment project properties, the Version number
    is there. Is there a line of code that I can use where I can assign the
    version number to the appVersion variable, something like
    "appVersion=sys tem.deploymenta pp.properties.v ersion" but that actually works?

    Many thanks,
    --
    Cary
  • Robin Tucker

    #2
    Re: Assign deployment version number to a variable


    Assuming you are setting your version number in the AssemblyInfo.vb file,
    this should do it:

    s_VersionMajor =
    System.Reflecti on.Assembly.Get ExecutingAssemb ly.GetName.Vers ion.Major()
    s_VersionMinor =
    System.Reflecti on.Assembly.Get ExecutingAssemb ly.GetName.Vers ion.Minor()
    s_VersionBuild =
    System.Reflecti on.Assembly.Get ExecutingAssemb ly.GetName.Vers ion.Build()
    s_VersionRevisi on =
    System.Reflecti on.Assembly.Get ExecutingAssemb ly.GetName.Vers ion.Revision()



    "Cary" <Cary@discussio ns.microsoft.co m> wrote in message
    news:2B1C6CE3-8577-4698-B84D-6A5F5BA92164@mi crosoft.com...[color=blue]
    > In my project, I want to display the version number on the splash screen
    > and
    > in the help section of my application. I have a variable I created called
    > appVersion. When I go to my deployment project properties, the Version
    > number
    > is there. Is there a line of code that I can use where I can assign the
    > version number to the appVersion variable, something like
    > "appVersion=sys tem.deploymenta pp.properties.v ersion" but that actually
    > works?
    >
    > Many thanks,
    > --
    > Cary[/color]


    Comment

    • Cary

      #3
      Re: Assign deployment version number to a variable

      Actually, it turns out all this time I hadn't touched the AssemblyInfo.vb
      file. I've been putting information like the version umber, manufacturer,
      product name, etc. in the Deployment Project Properties (where the
      ProductCode and UpgradeCode properties are located).

      Do you know how to access the Version number on the Deployment Project
      Properties?

      "Robin Tucker" wrote:
      [color=blue]
      >
      > Assuming you are setting your version number in the AssemblyInfo.vb file,
      > this should do it:
      >
      > s_VersionMajor =
      > System.Reflecti on.Assembly.Get ExecutingAssemb ly.GetName.Vers ion.Major()
      > s_VersionMinor =
      > System.Reflecti on.Assembly.Get ExecutingAssemb ly.GetName.Vers ion.Minor()
      > s_VersionBuild =
      > System.Reflecti on.Assembly.Get ExecutingAssemb ly.GetName.Vers ion.Build()
      > s_VersionRevisi on =
      > System.Reflecti on.Assembly.Get ExecutingAssemb ly.GetName.Vers ion.Revision()
      >
      >
      >
      > "Cary" <Cary@discussio ns.microsoft.co m> wrote in message
      > news:2B1C6CE3-8577-4698-B84D-6A5F5BA92164@mi crosoft.com...[color=green]
      > > In my project, I want to display the version number on the splash screen
      > > and
      > > in the help section of my application. I have a variable I created called
      > > appVersion. When I go to my deployment project properties, the Version
      > > number
      > > is there. Is there a line of code that I can use where I can assign the
      > > version number to the appVersion variable, something like
      > > "appVersion=sys tem.deploymenta pp.properties.v ersion" but that actually
      > > works?
      > >
      > > Many thanks,
      > > --
      > > Cary[/color]
      >
      >
      >[/color]

      Comment

      Working...