Assign deployment version number to a variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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=system.deploymentapp.properties.version" but that actually works?

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

s_VersionMajor =
System.Reflection.Assembly.GetExecutingAssembly.GetName.Version.Major()
s_VersionMinor =
System.Reflection.Assembly.GetExecutingAssembly.GetName.Version.Minor()
s_VersionBuild =
System.Reflection.Assembly.GetExecutingAssembly.GetName.Version.Build()
s_VersionRevision =
System.Reflection.Assembly.GetExecutingAssembly.GetName.Version.Revision()
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top