Home All Groups Group Topic Archive Search About

Build Number - how to auto increment?

Author
22 May 2009 8:14 PM
Terry
I can't believe I can't find the ansewer to this question anywhere, but so
far I have had no luck searching the forums or the help.  I am using VS2008
Professional and can not figure out how to auto-increment the build number. 
I have built this assembly many times, yet the My.Application.Info.Build
property returns 0.  What am I missing.  VB6 had an auto-increment on the
project properties dialog,  but I can not find something similiar in VS2008.
--
Terry

Author
22 May 2009 11:00 PM
Alex Clark
Put a * in place of the number in the project properties, for example
instead of setting the version to 1.0.0.0, set it to 1.0.*.* and that will
auto-increment the build & revision numbers each time you compile.

-Alex

Show quoteHide quote
"Terry" <TerryCLa@nospam.nospam> wrote in message
news:EA5529E5-FAAC-4C7B-9A62-AC8562EED12A@microsoft.com...
>I can't believe I can't find the ansewer to this question anywhere, but so
> far I have had no luck searching the forums or the help.  I am using
> VS2008
> Professional and can not figure out how to auto-increment the build
> number.
> I have built this assembly many times, yet the My.Application.Info.Build
> property returns 0.  What am I missing.  VB6 had an auto-increment on the
> project properties dialog,  but I can not find something similiar in
> VS2008.
> --
> Terry
Author
23 May 2009 12:26 PM
Terry
Thanks!
--
Terry


Show quoteHide quote
"Alex Clark" wrote:

> Put a * in place of the number in the project properties, for example
> instead of setting the version to 1.0.0.0, set it to 1.0.*.* and that will
> auto-increment the build & revision numbers each time you compile.
>
> -Alex
>
> "Terry" <TerryCLa@nospam.nospam> wrote in message
> news:EA5529E5-FAAC-4C7B-9A62-AC8562EED12A@microsoft.com...
> >I can't believe I can't find the ansewer to this question anywhere, but so
> > far I have had no luck searching the forums or the help.  I am using
> > VS2008
> > Professional and can not figure out how to auto-increment the build
> > number.
> > I have built this assembly many times, yet the My.Application.Info.Build
> > property returns 0.  What am I missing.  VB6 had an auto-increment on the
> > project properties dialog,  but I can not find something similiar in
> > VS2008.
> > --
> > Terry
>
>
>
Author
23 May 2009 1:12 PM
Terry
Sorry, I should have tried it before I got back to you.  When I attempt to
put the * in the last two boxes, I get an "invalid version format" message. 
I have tried various combinations and the only one it will accept is 1.0.0.*.
I am using VS 2008 if that makes any difference.
--
Terry


Show quoteHide quote
"Alex Clark" wrote:

> Put a * in place of the number in the project properties, for example
> instead of setting the version to 1.0.0.0, set it to 1.0.*.* and that will
> auto-increment the build & revision numbers each time you compile.
>
> -Alex
>
> "Terry" <TerryCLa@nospam.nospam> wrote in message
> news:EA5529E5-FAAC-4C7B-9A62-AC8562EED12A@microsoft.com...
> >I can't believe I can't find the ansewer to this question anywhere, but so
> > far I have had no luck searching the forums or the help.  I am using
> > VS2008
> > Professional and can not figure out how to auto-increment the build
> > number.
> > I have built this assembly many times, yet the My.Application.Info.Build
> > property returns 0.  What am I missing.  VB6 had an auto-increment on the
> > project properties dialog,  but I can not find something similiar in
> > VS2008.
> > --
> > Terry
>
>
>
Author
27 May 2009 11:48 AM
Phill W.
Alex Clark wrote:

> Put a * in place of the number in the project properties, for example
> instead of setting the version to 1.0.0.0, set it to 1.0.*.* and that will
> auto-increment the build & revision numbers each time you compile.

Please note - this doesn't simply /increment/ these values.  It
recalculates them according to these rules:

http://www.eggheadcafe.com/aspnet_answers/vsnetgeneral/May2006/post26751279.asp

> ... you specify an asterisk (*) for the version's build number
> (e.g. "1.0.*"). This will cause build number to be equal to
> the number of days since January 1, 2000 local time, and for
> revision to be equal to the number of seconds since midnight
> local time, divided by 2.

Also, if you start writing libraries (DLL's) make sure you /only/ update
the Assembly/File/Version in this way and *not* the /Assembly/Version.
Everything in .Net is implicitly Early Bound, so applications built
against [Assembly] Version 1.2.3.4 will not "just work" if you later
release the same DLL [Assembly] Version 1.2.3.*5*.
Of course, you can use Manifests to handle this, but the /default/
behaviour is for applications to /only/ run against the version they
were built with.

HTH,
    Phill  W.
Author
23 May 2009 9:17 AM
(O)enone
Terry wrote:
> I can't believe I can't find the ansewer to this question anywhere, but so
> far I have had no luck searching the forums or the help.  I am using VS2008
> Professional and can not figure out how to auto-increment the build number. 

Although you can use * for parts of the version number, I always wanted
greater control over versioning than this. I wanted to define the
initial private built part and have this incremented by 1 each time I built.

To do this I adapted a macro which does the job very well. You can find
the original macro here:

http://www.jmedved.com/default.aspx?page=vbnet_vb6ver&rendering=xhtml&language=en

This modifies the AssemblyInfo.vb file (which is normally hidden away
inside the 'My Project' folder) so you'll need to set this up as
required and ensure that it is editable if under source code control.

One of the changes I made to the macro was to get it to update the
AssemblyFileVersion attribute instead of the AssemblyVersion attribute.
AssemblyFileVersion is the version number that appears in Explorer and
when you select Properties for an executable. If you change
AssemblyVersion, anything that was referencing your component will fail
to bind to the new version, but the AssemblyFileVersion is ignored for
this check and can be changed to whatever you want.

HTH.

--
(O)enone
Author
23 May 2009 12:26 PM
Terry
Thanks!
--
Terry


Show quoteHide quote
"(O)enone" wrote:

> Terry wrote:
> > I can't believe I can't find the ansewer to this question anywhere, but so
> > far I have had no luck searching the forums or the help.  I am using VS2008
> > Professional and can not figure out how to auto-increment the build number. 
>
> Although you can use * for parts of the version number, I always wanted
> greater control over versioning than this. I wanted to define the
> initial private built part and have this incremented by 1 each time I built.
>
> To do this I adapted a macro which does the job very well. You can find
> the original macro here:
>
> http://www.jmedved.com/default.aspx?page=vbnet_vb6ver&rendering=xhtml&language=en
>
> This modifies the AssemblyInfo.vb file (which is normally hidden away
> inside the 'My Project' folder) so you'll need to set this up as
> required and ensure that it is editable if under source code control.
>
> One of the changes I made to the macro was to get it to update the
> AssemblyFileVersion attribute instead of the AssemblyVersion attribute.
> AssemblyFileVersion is the version number that appears in Explorer and
> when you select Properties for an executable. If you change
> AssemblyVersion, anything that was referencing your component will fail
> to bind to the new version, but the AssemblyFileVersion is ignored for
> this check and can be changed to whatever you want.
>
> HTH.
>
> --
> (O)enone
>
Author
23 May 2009 1:01 PM
Terry
Sorry, but I have another question.  I downloaded the macro, but how do I
'connect' it to the solution build.  The documentation I have found talks
about building a console app and then calling it.  But this does not look
like that approach as it is a handler for the BuildStart event.  If you don't
mind, can you connect the pieces for me?

--
Terry


Show quoteHide quote
"(O)enone" wrote:

> Terry wrote:
> > I can't believe I can't find the ansewer to this question anywhere, but so
> > far I have had no luck searching the forums or the help.  I am using VS2008
> > Professional and can not figure out how to auto-increment the build number. 
>
> Although you can use * for parts of the version number, I always wanted
> greater control over versioning than this. I wanted to define the
> initial private built part and have this incremented by 1 each time I built.
>
> To do this I adapted a macro which does the job very well. You can find
> the original macro here:
>
> http://www.jmedved.com/default.aspx?page=vbnet_vb6ver&rendering=xhtml&language=en
>
> This modifies the AssemblyInfo.vb file (which is normally hidden away
> inside the 'My Project' folder) so you'll need to set this up as
> required and ensure that it is editable if under source code control.
>
> One of the changes I made to the macro was to get it to update the
> AssemblyFileVersion attribute instead of the AssemblyVersion attribute.
> AssemblyFileVersion is the version number that appears in Explorer and
> when you select Properties for an executable. If you change
> AssemblyVersion, anything that was referencing your component will fail
> to bind to the new version, but the AssemblyFileVersion is ignored for
> this check and can be changed to whatever you want.
>
> HTH.
>
> --
> (O)enone
>
Author
24 May 2009 12:30 AM
Michael C
"Terry" <TerryCLa@nospam.nospam> wrote in message
news:EA5529E5-FAAC-4C7B-9A62-AC8562EED12A@microsoft.com...
>I can't believe I can't find the ansewer to this question anywhere, but so
> far I have had no luck searching the forums or the help.  I am using
> VS2008
> Professional and can not figure out how to auto-increment the build
> number.
> I have built this assembly many times, yet the My.Application.Info.Build
> property returns 0.  What am I missing.  VB6 had an auto-increment on the
> project properties dialog,  but I can not find something similiar in
> VS2008.

This feature never worked in VB6 anyway as it always needed manual
intervention in a team environment.

Show quoteHide quote
> --
> Terry