VB.NET application Version

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a VB.NET application that is deployed to an end user. I would like to
display on screen the application version of the application so that I know
the end user id using the latest version of our software.

How do you access the property of the application version?
 
With the assumption that this is a Windows Form application....Take a look
at System.Windows.Forms.Application.ProductVersion.

Michael
 
No, I don't think that is what I am looking for. What I wanted was the
Version that a developer can set when a setup package is created (i.e. 1.0.0
or 1.0.1). These version numbers seem to be some kind of internal version
number by file.
 
Im in VB2003

try this

Function VersionNumber() As String
Dim VersionNo As System.Version =
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version

Return VersionNo.Major.ToString & "." & _
VersionNo.Minor.ToString & "." & _
VersionNo.Build.ToString & "." & _
VersionNo.Revision.ToString
End Function


' if you double click on the code of the AssemlbyInfo.vb you should see a
line on the bottom that looks similar to this;
<Assembly: AssemblyVersion("1.00.0.0")>

Is that the version you are looking for?

Miro
 
Now I think I understand. For displaying a version number, a developer would
use the Assembly.vb to increment the version number. I was trying to use the
setup version number, but I believe that is unaccessable during execution
because that version umber is only used on installs. Correct?

I have it working now, once I updated the assembly.vb.
 
Sorry that my first crack at it didn't give you the information that you
were looking for. :) There are a couple of things that you should keep in
mind.

Version of Assembly: <Assembly: AssemblyVersion("1.00.0.0")>
Version of Product: <Assembly: AssemblyInformationalVersion("1.0")>
File Version (of DLL): <Assembly: AssemblyFileVersion("1.0.*")>

The ProductVersion that I showed returns the AssemblyInformationalVersion
string. By default AssemblyInformationVersion and AssemblyFileVersion are
not included in the AssemblyInfo file and they default to the value of
AssemblyVersion so it would have returned the same value. You can read more
about them in the MSDN help, but Miro's answer will work for you to! :)

Michael
 
Back
Top