Application Version (Major, Minor, Build)...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

Anyone knows how to change (increment) the Major, Minor or Build version of an application
Wy the build version has a value of (18149) ?

My code is this one
Major = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly.Location).FileMajorPar
Minor = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly.Location).FileMinorPar
Build = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly.Location).FilePrivatePar

Thanks for your help
Bernard
 
Hi Bernardo,

You can update the values in the assembly level [AssemblyVersion] attribute
(You usually find this in AssemblyInfo.cs in VS.NET generated projects).

For example:
[assembly: AssemblyVersion("1.0.0.0")]

The documentation for AssemblyVersion also has teh details on the effect
of using wildcards for the build and revision numbers.

Regards,
Aravind C
 
Bernardo,

One small suggestion; you can cut down on the number of calls needed
to retrive the version information. Please remember that first of all, it is
always good to store a temporary reference to a deeply nested object if
you are going to call it more than once, and then there are a shorter way
of getting a hold of that object

Version v =
Assembly.GetCallingAssembly().GetName().Version

int build = v.Build;
int minor = v.Minor;
int major = v.Major;
int revision = v.Revision;

Just a thought =)

Hope this helps,

//Andreas

Aravind C said:
Hi Bernardo,

You can update the values in the assembly level [AssemblyVersion] attribute
(You usually find this in AssemblyInfo.cs in VS.NET generated projects).

For example:
[assembly: AssemblyVersion("1.0.0.0")]

The documentation for AssemblyVersion also has teh details on the effect
of using wildcards for the build and revision numbers.

Regards,
Aravind C


Bernardo said:
Hi,

Anyone knows how to change (increment) the Major, Minor or Build version of an application?
Wy the build version has a value of (18149) ??

My code is this one:
Major =
System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly
.GetExecutingAssembly.Location).FileMajorPart
Minor =
System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly
.GetExecutingAssembly.Location).FileMinorPart
Build =
System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly
.GetExecutingAssembly.Location).FilePrivatePart

Thanks for your help,
Bernardo
 
When using the wild card the build and revision numbers are auto
generated, which may cause a problem when you wish to install your own
new version assembly into the GAC.

with regards,


J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com
 
Back
Top