473,395 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Version number

How to get the current version number of my app so i can put it at the title
bar?

TIA

Nov 21 '05 #1
9 6258
Nikolay,

\\\
MessageBox.Show( _
System.Reflection.Assembly.GetExecutingAssembly( _
).GetName().Version.ToString())
'or
MessageBox.Show( _
System.Windows.Forms.Application.ProductVersion)
///

I hope this helps a little bit?

Cor
"
Nov 21 '05 #2
Nikolay,

\\\
MessageBox.Show( _
System.Reflection.Assembly.GetExecutingAssembly( _
).GetName().Version.ToString())
'or
MessageBox.Show( _
System.Windows.Forms.Application.ProductVersion)
///

I hope this helps a little bit?

Cor
"
Nov 21 '05 #3
Hello,

I use the following line:-

Me.Text = String.Format("{0} ({1})", Me.Text,
Reflection.Assembly.GetExecutingAssembly().GetName .Version)

And then in assemblyinfo.vb have the version number set automatically or
override it yourself etc.

Hope this helps,
Regards
Simon Jefferies
mailto:simon[nospam]@cooltoolsonline.co.uk
-- remove [nospam] to email me --
"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
How to get the current version number of my app so i can put it at the
title bar?

TIA

Nov 21 '05 #4
Hello,

I use the following line:-

Me.Text = String.Format("{0} ({1})", Me.Text,
Reflection.Assembly.GetExecutingAssembly().GetName .Version)

And then in assemblyinfo.vb have the version number set automatically or
override it yourself etc.

Hope this helps,
Regards
Simon Jefferies
mailto:simon[nospam]@cooltoolsonline.co.uk
-- remove [nospam] to email me --
"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
How to get the current version number of my app so i can put it at the
title bar?

TIA

Nov 21 '05 #5
Assembly.GetExecutingAssembly().GetName().Version

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
How to get the current version number of my app so i can put it at the title
bar?

TIA


Nov 21 '05 #6
Assembly.GetExecutingAssembly().GetName().Version

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
How to get the current version number of my app so i can put it at the title
bar?

TIA


Nov 21 '05 #7
"Nikolay Petrov" <jo**************@mail.bg> schrieb:
How to get the current version number of my app so i can put it at the
title bar?


Structure of version numbers and methods to determine the version number
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=versioning&lang=en>

Notice that it's not best practice to put the version number into the title
bar. Instead, display the version number in the about dialog.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #8
"Nikolay Petrov" <jo**************@mail.bg> schrieb:
How to get the current version number of my app so i can put it at the
title bar?


Structure of version numbers and methods to determine the version number
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=versioning&lang=en>

Notice that it's not best practice to put the version number into the title
bar. Instead, display the version number in the about dialog.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #9
Nikolay,
In addition to the other comments:

The "easiest" way in VB.NET to get the Version number of a VB.NET Windows
Application is to use Application.ProductVersion, Application is found in
the System.Windows.Forms namespace.

To get the "product" Version of individual Assemblies I use the following
code to get the product version of specific assemblies:

Private Function GetProductVersion(ByVal [assembly] As
System.Reflection.Assembly) As String
Dim attributes() As Object
attributes =
[assembly].GetCustomAttributes(GetType(System.Reflection.Ass emblyInformationalVersionAttribute),
False)
If attributes.Length > 0 Then
Dim assemblyProductVersion As
System.Reflection.AssemblyInformationalVersionAttr ibute =
DirectCast(attributes(0),
System.Reflection.AssemblyInformationalVersionAttr ibute)
Return assemblyProductVersion.InformationalVersion
Else
Return String.Empty
End If
End Function
Similarly there is a Application.ProductName that will get the name of your
Product, Application.ProductName returns the value of the
AssemblyProductAttribute found in the AssemblyInfo.vb file of your project.
If you leave this attribute its default value of blank then you get the root
namespace of the project. However if you change the attribute's value then
you will get the new value.

I normally change the AssemblyProductAttribute to a displayable value & use
Application.ProductName as my message box titles.

Note Application.ProductVersion comes from the
AssemblyInformationalVersionAttribute if you add it to your AssemblyInfo.vb
file, if you do not add AssemblyInformationalVersion, then
Application.ProductVersion comes from the AssemblyVersionAttribute:

For example, if my root namespace is "TheGreatAndWonderfulApp", I might set
my AssemblyInfo.vb file as:

' somewhere in the AssemblyInfo.vb file:
....
<Assembly: AssemblyProduct("The Great & Wonderful Application")>
....
<Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyInformationalVersion("1.0.0")> ' Product Version

Hope this helps
Jay

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
How to get the current version number of my app so i can put it at the
title bar?

TIA

Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: mekim | last post by:
Hello....I am trying to System.Reflection.Assembly.GetExecutingAssembly ().GetName ().Version.ToString () ; to display the version of the app...but it remains static and therefore does not...
4
by: John | last post by:
Hi Is there a way to get the version number of my vb.net app, that is provided by vs? Thanks Regards
8
by: John | last post by:
Hi How can I change the product version number that is returned by Application.ProductVersion? Thanks Regards
12
by: joanne | last post by:
how to tell application version after i installed it at client side? i did make the version and product code while doing the packaging and deployment. Thanks a lot.
4
by: Dave Cullen | last post by:
Where in a VB.NET project do you get to set the version properties of your executable? Version number, Copyright, biuld comments, etc (the stuff that shows up when you right-click...
3
by: Jeff | last post by:
I've been looking and looking for how to set the version numbers for my visual studio project...where the heck is it? Used to be able to do it from project properties in VB6. I found out how to...
0
by: ev951 | last post by:
I am not that familiar with XML or XSL and I am trying to sort application version number strings in an XML file that my team uses for application installations on our Linux servers. I have tried...
6
by: Gavin Sullivan | last post by:
I've been using the date (in YMMDD) format for the build number in the AssemblyVersion attribute. However, it appears that numbers 65534 are invalid!! Bit of a bummer for 2007!!! Is there a...
1
by: ewingate | last post by:
I cannot seem to get the version number of my VB app to increment properly in VS2005. When I build the app each day the "build" number increments with no problem as does the version number but if I...
14
by: Phil | last post by:
I have been using this code to display the version number, and this has worked well, but I am now changing from using the ClickOnce publishing to a proper setup project, and this no longer works. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.