|
-
May 14th, 2009, 05:35 AM
#1
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
-
May 14th, 2009, 06:01 AM
#2
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?
-
May 14th, 2009, 06:30 AM
#3
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?
-
May 14th, 2009, 12:00 PM
#4
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.
-
May 16th, 2009, 12:19 PM
#5
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)
Last edited by purpleflash; May 18th, 2009 at 11:11 AM.
Reason: add clarification
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|