Assembly Version Question

Hello all,
I have a question about the assembly:version.
I have created a help/about box that I show the version of software.
But I really do not like the way VB.Net does it.
I have tried a few things to parse the info I want, but to no avail.
What I want would be to display something of this nature:

Version 1.0 Build 24
And have the build update automaticaly and I would manually control the 1.0, 1.1, 1.2, 2.0, etc

Any ideas?

Thanks,
Akula
LVL 1
AkulaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Look in the AssemblyInfo.vb file, and notice that the version is 1.0.*.  If you want to control the version, then remove the asterisk, and just use 1.0, 1.1, etc.

Bob
0
AkulaAuthor Commented:
Thanks Bob,
I do understatnd that part and I have done that.
What I want to do is the build version.
I can not get it to work the way I like.
I don't like the 4 digit version it uses, I'd rather have a 2 digit version that I am trying to parse, but with no look.

Ak
0
Bob LearnedCommented:
Are you looking for something like this:

Imports System.Reflection.Assembly

Public Class App

  Public Shared Function MajorVersion() As String

    Return GetExecutingAssembly.GetName.Version.Major

  End Function


  Public Shared Function MinorVersion() As String

    Return GetExecutingAssembly.GetName.Version.Minor

  End Function


  Public Shared Function BuildNumber() As String

    Return GetExecutingAssembly.GetName.Version.Build

  End Function


  Public Shared Function Revision() As String

    Return GetExecutingAssembly.GetName.Version.Revision

  End Function


  Public Shared Function ProductVersion() As String

    Return App.MajorVersion & "." & App.MinorVersion & "." & _
           App.Revision() & "." & App.BuildNumber()

  End Function

End Class


Bob
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

AkulaAuthor Commented:
Hi Bob,
That is basically what I wnat and what I have done also.
However, I may have not asked my question properly.
I would like my about box to state :

Version 1.0 Build 17

and then after new build:

Version 1.0 Build 18

But, in the App.BuilderNumber() of your code and mine, it is 4 digits.
I tried to parse it for the first 2 digits, but the digits remained the same while the last 2 were changing.
I realize it will change eventually, but I need a way to do it as listed above.

Any idea?

Thanks,
Ak
0
Bob LearnedCommented:
Show me this line from your AssemblyInfo.vb:

<Assembly: AssemblyVersion("1.0.0.0")>

Bob
0
AkulaAuthor Commented:

<Assembly: AssemblyVersion("2.0.*")>
0
Bob LearnedCommented:
Change it to:

<Assembly: AssemblyVersion("2.0.0.0")>

Then, tell me what the BuildNumber returns.

Bob
0
AkulaAuthor Commented:
It returns 0
0
Bob LearnedCommented:
And if you change it to Assembly: AssemblyVersion("2.1.0.17")>, you would get v2.1 Build 17.

This is what you need:

Public Shared Function ProductVersion() As String

    Return App.MajorVersion & "." & App.MinorVersion & " " & _
           "Build " & App.BuildNumber()

  End Function


Bob
0
AkulaAuthor Commented:
This is good Bob,
But how can this automate the last digit?
It doesn't appear to update when I build when it is this way?
Thanks,
Ak
0
Bob LearnedCommented:
You are in control of it now, there isn't anything (that I know of) to automatically increment this once you remove the asterisk.

Bob
0
Bob LearnedCommented:
This might help:

Managing assembly version numbers using Visual Studio .NET and Visual SourceSafe
http://www.codeproject.com/dotnet/ManagingAssemblyVersions.asp

UpdateVersion
http://code.mattgriffith.net/UpdateVersion/

Bob
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.