VB.NET: How To Find Application Build Version

free web hosting
Free Web Hosting > Computers & Tech > Programming > Programming General > BASIC / Visual Basic (.NET)

VB.NET: How To Find Application Build Version

tansqrx
This seams pretty simple but I can't seam to find it out on the net. I would like to include the build information in my help dialogue box.

Ex.

----------------------------
| Welcome to help |
| Build 132 |
----------------------------

after the next recompile

----------------------------
| Welcome to help |
| Build 133 |
----------------------------

Sorry for the cheesey ascii but I figured it would be the best to get my point across.

Reply

wykked_dreamz
tansqrx im not sure i understand what you are saying. what are you trying to build? the ascii is fine but i dont think that your point got across to me. sorrie, im a little slow at times.

Reply

miCRoSCoPiC^eaRthLinG
Hi tansqrx,
    Here's your solution...

First of all your AssemblyInfo.vb contains all information on your Version/Major/Minor Builds etc.
If you take a look into that file you'll see:
QUOTE
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("1.0.0.0")>


Now .NET provides you with a prebuilt class called FileVersionInfo which fetches this information out of your assembly or ANY given executable file.. Here's a little code-snippet that demonstrates this:

CODE

Dim myBuildInfo As FileVersionInfo = FileVersionInfo.GetVersionInfo(Application.ExecutablePath)

MsgBox("Product build part number: " &  myBuildInfo.ProductBuildPart)


The the method named GetVersionInfo of this class fetches the information from an exe file which is specified within the paranthesis () - in this example I've used Application.ExecutablePath - which returns the path of the currently executing program including the filename - i.e. the program in which you're using this code.

The MsgBox displays the Build Information by calling the ProductBuildPart method - which extracts the build information from the Version string - of the format a.b.c.d - here the part contained in "c" is your Build Version. Use this same routine to populate your Help box.

Reminder: You'll have to upgrade the build number in your AssemblyInfo.vb file too - by default when you start writing a new application, it's set to as 1.0.0.0 - if you don't change this, your product build will always get reported as "0" or whatever you set the last build number too - this doesn't get updated automatically upon subsequent recompiles. This has to be done manually.

Don't forget to experiment with the other members of this class - they enable you to extract the Major-Minor Version/Revision info and other stats from the version string too...

Hope this helps smile.gif

Regards,
m^e

P.S. Don't look so far tongue.gif It's right there in your MSDN libraries.. just a simple search for Version Infomation would have got you the results wink.gif I was in the same shoes as you an year back tongue.gif

 

 

 


Reply

tansqrx
As always thank you microscopic^earthling.

Reply

miCRoSCoPiC^eaRthLinG
Glad that helped. smile.gif Issue resolved. Topic closed.

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Recent Queries:-
  1. how to access asp.net application build number c# - 0.04 hr back. (1)
  2. version revision vb.net application - 0.41 hr back. (1)
  3. .net application build number - 0.64 hr back. (2)
  4. vb.net difference product and file version - 0.91 hr back. (1)
  5. .net buildversion - 0.96 hr back. (2)
  6. vb.net show build number - 1.51 hr back. (1)
  7. get application revision in vb.net - 2.55 hr back. (1)
  8. get version vb.net - 3.52 hr back. (1)
  9. .net get build number - 3.58 hr back. (1)
  10. build version vb - 3.80 hr back. (1)
  11. getfileversion vb ftp - 5.63 hr back. (1)
  12. .net c# get system build version - 5.86 hr back. (1)
  13. vb.net get application version - 3.95 hr back. (2)
  14. .net get build version information - 5.96 hr back. (1)
Similar Topics

Keywords : vb, net, application, build, version

  1. Need A Barcode Scanner Application
    (8)
  2. Visual Basic: Unload Your Application Correctly!
    (1)
    What many of us do not know is that using a button on a form with the function "Unload Form1" or
    even clicking the X in the upper right corner is like pulling the plug out of your computer while it
    is still on. It may not exit the program cleanly and efficiently, may leave background processes
    running, or just give you unwanted errors by exiting improperly. All you need to do is unload all
    components, forms, controls, etc. upon unloading. Say you have 2 forms in your project, 1
    component, and 2 controls. If these ojects are placed onto a form, unload them properly!....

    1. Looking for vb, net, application, build, version






*SIMILAR VIDEOS*
Searching Video's for vb, net, application, build, version
advertisement




VB.NET: How To Find Application Build Version