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

F

Frank V.

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.GetName.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
 
K

Ken Tucker [MVP]

Hi,

Take a look at Application.ProductVersion()


Ken

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

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.GetName.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
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (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.
 
F

Frank Villlasenor

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

System.Reflection.Assembly.GetExecutingAssembly.GetName.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
 
F

Frank Villlasenor

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
 
P

Phill. W

(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

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.
 
F

Frank Villlasenor

Phill W.

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

Frank V.
 

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

Top