product version no

J

John

Hi

How can I change the product version number that is returned by
Application.ProductVersion?

Thanks

Regards
 
J

Jay B. Harlow [MVP - Outlook]

John,
As Ken stated, you change it in the AssemblyInfo.vb file. Actually you
change it with AssemblyInformationVersion attribute, which I normally place
in the AssemblyInfo.vb file along with all the other attributes dealing with
the assembly.

Normally you will only find the AssemblyVersion attribute in the
AssemblyInfo.vb file. You can add the AssemblyInformationVersion and
AssemblyFileVersion attributes if you want. All three values will use
AssemblyVersion if you do not include the other two attributes.

AssemblyVersion - the version number of the assembly.
AssemblyInformationVersion - the version number of the product itself
AssemblyFileVersion - the version number of the file

In my current project I am using both the AssemblyVersion number & the
AssemblyInformationVersion.

Hope this helps
Jay
 
J

John

There is an * in the version number. Where is the value for * coming from?
Also, is there an automatic way to increase the no with every build?

Thanks

Regards
 
J

Jay B. Harlow [MVP - Outlook]

John,
Also, is there an automatic way to increase the no with every build?
The * in the version number, is the automatic way of changing the number
with every build, note it does not actually increment the number.

The * actually causes the current date & time to be encoded into the build
number, I'm not sure if its actual date & time or when you last started
VS.NET.

I believe the only way to get different behavior is to modify the file
during the build event with a VS.NET add-in or macro.

Hope this helps
Jay
 
H

Herfried K. Wagner [MVP]

* "John said:
How can I change the product version number that is returned by
Application.ProductVersion?

Basic information on versioning:

<http://msdn.microsoft.com/library/en-us/dndotnet/html/managevers.asp>
<http://msdn.microsoft.com/library/en-us/dnbda/html/tdlg_ch5.asp>
<http://msdn.microsoft.com/library/en-us/cptutorials/html/versioning_components.asp>

Parts of the version number:

Main version
"Product" version.
Sub version
Sub version, for example Service Pack.
Build
During development, auto-increment.
Revision
Hotfix or Quick Fix Engineering (QFE).

When using auto incrementation of numbers, the build number contains the
number of days since January, 2000; the revision contains the number of
seconds since midnight divided by 2.

The version number can be changed in the file "AssemblyInfo.vb". The
version number will updated automatically when re-opening the solution.
 
C

Chris Dunaway

John,
The * in the version number, is the automatic way of changing the number
with every build, note it does not actually increment the number.

Jeffrey Richter, in his book, "Applied Microsoft .Net Framework
Programming", warns not to use the "1.0.*" syntax. He recommends that the
build number be specifically set to a value. In regards to the automatic
increment of the build number he states:

<QUOTE>
This feature is a bug and shouldn't be used because changing the assembly
version number will break any assemblies that reference this assembly. The
AssemblyInfo.cs file that Visual Studio .Net automatically creates for you
when you create a new project is in error: it sets the AssemblyVersion
attribute so that its major and minor parts are 1.0 and that the build and
revision parts are automatically updated by the compiler. You should
definitely modify this file and hard-code all four parts of the assembly
version number.
</QUOTE>

His book talks about versioning information in detail.
 
J

John

I have got AssemblyVersion("1.0.*") in my assembly.vb. No matter how many times I reopen, change or rebuild the project, my build remains the same. For some reason automatic build increment is not working for me. Any ideas?
 
J

Jay B. Harlow [MVP - Outlook]

John,
Not sure what to offer, as it works for me.

Which version of VS.NET are you using? VS.NET 2002, VS.NET 2003, a pre 2002
beta, or the Whidbey beta/preview?

Hope this helps
Jay

I have got AssemblyVersion("1.0.*") in my assembly.vb. No matter how many
times I reopen, change or rebuild the project, my build remains the same.
For some reason automatic build increment is not working for me. Any ideas?
 
J

John

vs.net 2003 upgrade

Jay B. Harlow said:
John,
Not sure what to offer, as it works for me.

Which version of VS.NET are you using? VS.NET 2002, VS.NET 2003, a pre 2002
beta, or the Whidbey beta/preview?

Hope this helps
Jay

I have got AssemblyVersion("1.0.*") in my assembly.vb. No matter how many
times I reopen, change or rebuild the project, my build remains the same.
For some reason automatic build increment is not working for me. Any ideas?
 

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