Controlling ProductVersion

R

Richard Bixler

Hello - In VB.NET, how do I control product version, and access it for
reporting on my splash form? This is a simple .exe solution with a project
built out of a few forms and modules, and contains a setup project.

My vbproj file contains ProductVersion = "7.10.3077" . When I report
Application.ProductVersion, its value is 1.0.1723.16260 so clearly that
comes from somewhere else. Anyway, I don't want either of these values.

I would like to set the product version to 1.1.0, and report 1.1.0.build# .
So I'm looking for advice on how to set the value, and how to access it at
runtime.

Thanks in advance -- Dick Bixler
 
R

Ray Cassick \(Home\)

Checkout the values listed in your AssemblyInfo.vb file.

<Assembly: AssemblyVersion("1.0.*")>
 
R

Richard Bixler

Thanks. Here's what I did:

Imports System.Reflection
'Versioning is set in Scenery_Align\AssemblyInfo.vb
Dim myAssembly As [Assembly]
Dim myAssemblyName As AssemblyName
Dim myAssemblyVersion As String

myAssembly = [Assembly].GetExecutingAssembly()
myAssemblyName = myAssembly.GetName()
myAssemblyVersion = myAssemblyName.Version.ToString
Me.Label1.Text = myAssemblyVersion

Seems to work. Thanks again -- Dick Bixler
 

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