Version # always returns 1.0.0.1
Using this code:
Code:
Assembly myAssembly = Assembly.GetExecutingAssembly();
AssemblyName myAssemblyName = myAssembly.GetName();
textBox2.Text = "Client Version " + myAssemblyName.Version.ToString();
to get he version of my application and set it's value to a textbox.
My app is set up to auto-increment version #'s, and currently is 1.0.0.25
In the debgger, "myAssembly" return the application itself (as is expected) however it always returns 1.0.0.1 for the version. Always.
What's up and what do I need to change?
Using .Net 3.5SP1 on XP
Re: Version # always returns 1.0.0.1
in the Solution Explorer, expand the Properties entry, then open the AssembyInfo file. The last two lines show the assembly version. What do your's say?
Re: Version # always returns 1.0.0.1
Hmm:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
that explains it for sure... but should not this auto-increment since I have auto-increment turned on? Or do I make the change to this:
assembly: AssemblyVersion("1.0.*"
to enable it to auto-increment?
Re: Version # always returns 1.0.0.1
Yes you need to use the '*' in the version number for auto-version numbering to work.
Darwen.
Re: Version # always returns 1.0.0.1
Well, the problem then is it versions something like this:
1.0.1256.28472
instead of the 1.0.0.26 (or whatever) it actually is... but in the Properties window it shows the correct version (i.e., 1.0.0.26)