By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,250 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,250 IT Pros & Developers. It's quick & easy.

Assign deployment version number to a variable

P: n/a
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.versio n" but that actually works?

Many thanks,
--
Cary
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

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

s_VersionMajor =
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Version.Major()
s_VersionMinor =
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Version.Minor()
s_VersionBuild =
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Version.Build()
s_VersionRevision =
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Version.Revision()

"Cary" <Ca**@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com...
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.versio n" but that actually
works?

Many thanks,
--
Cary

Nov 21 '05 #2

P: n/a
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:

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

s_VersionMajor =
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Version.Major()
s_VersionMinor =
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Version.Minor()
s_VersionBuild =
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Version.Build()
s_VersionRevision =
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Version.Revision()

"Cary" <Ca**@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com...
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.versio n" but that actually
works?

Many thanks,
--
Cary


Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.