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

App.Major & App.Minor & [...] VB.Net Equivilant

P: n/a
Hello,
I'm new to VB.net, moving from VB6 to VB.net. My question is "In
VB.net what is the equivalent of the App.major (and others) VB6
property. I, like a lot of people I imaging, display the current
version number on my about form. Though I've used some code, I can't
get a version number that seems to update properly. I've read some
other posts that have mentioned 2 main things that I've learned.

1. <Assembly: AssemblyVersion("2.1.*")> <-- I can modify this, and
that will change my version of my Assembly. (I think that means the
final compiled file?) I can look at my EXE file properties and that
seems to be up to date.

2nd: System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Version.ToString
<-- I use that to get access to the version number that I set above.
(in this case, 2.1.*, and * being the build and revision that VB sets.

My concern and annoyance with this code that, it seems to only update
the revision and build code if i change my Assembly file.

So I guess in short, I'm looking for a version number that is for the
project globally.

Another question is what is the: System.Environment.Version.Major and
System.Environment.Version.Minor (and the rest) Are these form level
or what? and if so, is it possible to change them? Any input would be
appreciated, and I think you in advance!

-Frank Villasenor
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi,

Take a look at Application.ProductVersion()
Ken

------------------------

"Frank V." <ja*******@yahoo.com> wrote in message
news:76**************************@posting.google.c om...
Hello,
I'm new to VB.net, moving from VB6 to VB.net. My question is "In
VB.net what is the equivalent of the App.major (and others) VB6
property. I, like a lot of people I imaging, display the current
version number on my about form. Though I've used some code, I can't
get a version number that seems to update properly. I've read some
other posts that have mentioned 2 main things that I've learned.

1. <Assembly: AssemblyVersion("2.1.*")> <-- I can modify this, and
that will change my version of my Assembly. (I think that means the
final compiled file?) I can look at my EXE file properties and that
seems to be up to date.

2nd:
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Version.ToString
<-- I use that to get access to the version number that I set above.
(in this case, 2.1.*, and * being the build and revision that VB sets.

My concern and annoyance with this code that, it seems to only update
the revision and build code if i change my Assembly file.

So I guess in short, I'm looking for a version number that is for the
project globally.

Another question is what is the: System.Environment.Version.Major and
System.Environment.Version.Minor (and the rest) Are these form level
or what? and if so, is it possible to change them? Any input would be
appreciated, and I think you in advance!

-Frank Villasenor
Nov 20 '05 #2

P: n/a
* ja*******@yahoo.com (Frank V.) scripsit:
Another question is what is the: System.Environment.Version.Major and
System.Environment.Version.Minor (and the rest) Are these form level
or what? and if so, is it possible to change them? Any input would be
appreciated, and I think you in advance!


Basic information on versioning:

<URL:http://msdn.microsoft.com/library/en-us/dndotnet/html/managevers.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnbda/html/tdlg_ch5.asp>
<URL:http://msdn.microsoft.com/library/en-us/cptutorials/html/versioning_components.asp>

Parts of the version number:

Main version
"Product" version.

Sub version
Sub version, for example Service Pack.

Build
During development, auto-increment.

Revision
Hotfix or Quick Fix Engineering (QFE).

When using auto incrementation of numbers, the build number contains the
number of days since January, 2000; the revision contains the number of
seconds since midnight divided by 2.

The version number can be changed in the file "AssemblyInfo.vb". The
version number will updated automatically when re-opening the solution.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #3

P: n/a


Ken, Thank you. I've never noticed that before. But, that gives me the
exact same thing as the code

System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Version.ToString

Although, much shorter (coding wise), that still don't really answer my
question.

I've searched many web sites, and found nothing doing versioning in VB.
Thanks!

-Frank Villasenor

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #4

P: n/a

The version number can be changed in the file "AssemblyInfo.vb". The
version number will updated automatically when re-opening the solution

Ok, so the version number isn't undated everything that you compile the
program (like in Visual C++)?

Thank you very much for your response. The information that you gave me
we quite helpful.

-Frank villasenor

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #5

P: n/a
"Frank V." <ja*******@yahoo.com> wrote in message
news:76**************************@posting.google.c om...
(Apologies to VB "Proper" developers everywhere, but this is one
of my pet hates about Visual Fred!) . . .
1. <Assembly: AssemblyVersion("2.1.*")>
I can modify this, and that will change my version of my Assembly.
Get rid of the "*" (or "*.*")!
As you say , VB fills in the remander of the "version" for itself and
the numbers it uses make no sense whatever.
*Always* specify the version explicitly, as in

<Assembly: AssemblyVersion("2.1.0.0")>
My concern and annoyance with this code that, it seems to only
update the revision and build code if i change my Assembly file.
Correct. The /only/ way to change the "version" of your application
is to change the AssemblyInfo file.
So I guess in short, I'm looking for a version number that is for the
project globally.
You've already found it; for what it's worth.
what is the: System.Environment.Version.Major ... These are Framework classes/properties that give you the version
of the *Framework* - nothing to do with your application, specifically.
is it possible to change them?


Only by installing and using another version of the Framework ;-)

HTH,
Phill W.
Nov 20 '05 #6

P: n/a
Phill W.

Thanks a lot for the information. I highly appricated that you took
the time to respond to that.

Frank V.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.