Blog Home  Home Feed your aggregator (RSS 2.0)  
.Net Jonesie - AssemblyFileVersion side effect
A simple programmers blog
 
# Friday, August 05, 2005

This is one of those Friday afternoon problems.

In my 2005 Winforms client I have a nice fancy splash screen that displays the current version - 3.0.0.0 (yes, this is the 3rd version but the 1st .Net version) - which it retrieves from Application.ProductVersion.  Under the covers, ProductVersion is actually just AssemblyFileVersion from assemblyinfo.vb/cs.

Now, I wanted to have this auto increment the build number.  In VS03, you do something like this: [assembly: AssemblyFileVersion("3.0.0.*")] and the asterix is replaced with the next version on each build.  Well this didn't work.  All I got was "Version 3.0.0.*" in the splash screen.

Ok, fair enough, probably a beta issue or there is another way of doing it I'm not aware of.

HOWEVER, when I tried to exit the app, it crashed trying to save Properties.Settings.Default.  It said there was an invalid character in the file path.  Of course, there was an hour between these two issues so it took me a few minutes but eventually I figured that the version number is used in the settings file name.  Removing the asterix solved this problem.

FYI

Friday, August 05, 2005 4:08:43 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   General | Visual Studio  | 
Saturday, August 06, 2005 1:11:38 PM (New Zealand Standard Time, UTC+12:00)
Something like this worked for me (copy/pasted from wizard generated assembly file):


This is what the comment said:

' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
[assembly: AssemblyFileVersion("3.0.*")]
MoMad
Comments are closed.
Copyright © 2010 Peter G Jones. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: