469,627 Members | 1,054 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,627 developers. It's quick & easy.

Build v. Revision in AssemblyVersion

In the AssemblyInfo.cs page of a ASP.NET project, there is a defaulted
property of:

[assembly: AssemblyVersion("1.0.*")]

It's my understanding that this indicates a Major Version of 1, a Minor
Version of 0, and a Build and Revision that increment on their own. I could
modify the minor and major number above as it made "logical sense". Three
related questions:

1. Under what circumstances does the Build automatically increment?
2. Why does the revision increment by a 100+ each time I rebuild my
solution? Why not ... by one?
3. Will the code below display the correct related information ... or am I
misinterpreting their meaning by displaying them in this way (for internal
purposes)?

Thanks in advance!
Mark

System.Reflection.Assembly MyAssembly =
System.Reflection.Assembly.GetExecutingAssembly();
System.Version AppVersion = MyAssembly.GetName().Version;
string MyVersion = AppVersion.Major.ToString()
+ "." + AppVersion.Minor.ToString()
+ "." + AppVersion.Build.ToString()
+ "." + AppVersion.Revision.ToString();
Response.Write("Version: " + MyVersion);
Nov 16 '05 #1
2 4242
You are correct it is:
major_version.minor_version.build.revision

Here is the definition of how build and revision are calculated (when you
leave * in the AssemblyVersionAttribute)

FROM:
http://msdn.microsoft.com/library/de...ilityAlexe.asp

If you specify major and minor, you can specify an asterisk (*)for build.
This causes build to be equal to the number of days since January 1, 2000,
local time, and revision to be equal to the number of seconds since
midnight, January 1, 2000, local time, divided by 2.

--
Mike Mayer, C# MVP
mi**@mag37.com
http://www.mag37.com/csharp/
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
In the AssemblyInfo.cs page of a ASP.NET project, there is a defaulted
property of:

[assembly: AssemblyVersion("1.0.*")]

It's my understanding that this indicates a Major Version of 1, a Minor
Version of 0, and a Build and Revision that increment on their own. I could modify the minor and major number above as it made "logical sense". Three
related questions:

1. Under what circumstances does the Build automatically increment?
2. Why does the revision increment by a 100+ each time I rebuild my
solution? Why not ... by one?
3. Will the code below display the correct related information ... or am I
misinterpreting their meaning by displaying them in this way (for internal
purposes)?

Thanks in advance!
Mark

System.Reflection.Assembly MyAssembly =
System.Reflection.Assembly.GetExecutingAssembly();
System.Version AppVersion = MyAssembly.GetName().Version;
string MyVersion = AppVersion.Major.ToString()
+ "." + AppVersion.Minor.ToString()
+ "." + AppVersion.Build.ToString()
+ "." + AppVersion.Revision.ToString();
Response.Write("Version: " + MyVersion);

Nov 16 '05 #2
You are correct it is:
major_version.minor_version.build.revision

Here is the definition of how build and revision are calculated (when you
leave * in the AssemblyVersionAttribute)

FROM:
http://msdn.microsoft.com/library/de...ilityAlexe.asp

If you specify major and minor, you can specify an asterisk (*)for build.
This causes build to be equal to the number of days since January 1, 2000,
local time, and revision to be equal to the number of seconds since
midnight, January 1, 2000, local time, divided by 2.

--
Mike Mayer, C# MVP
mi**@mag37.com
http://www.mag37.com/csharp/
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
In the AssemblyInfo.cs page of a ASP.NET project, there is a defaulted
property of:

[assembly: AssemblyVersion("1.0.*")]

It's my understanding that this indicates a Major Version of 1, a Minor
Version of 0, and a Build and Revision that increment on their own. I could modify the minor and major number above as it made "logical sense". Three
related questions:

1. Under what circumstances does the Build automatically increment?
2. Why does the revision increment by a 100+ each time I rebuild my
solution? Why not ... by one?
3. Will the code below display the correct related information ... or am I
misinterpreting their meaning by displaying them in this way (for internal
purposes)?

Thanks in advance!
Mark

System.Reflection.Assembly MyAssembly =
System.Reflection.Assembly.GetExecutingAssembly();
System.Version AppVersion = MyAssembly.GetName().Version;
string MyVersion = AppVersion.Major.ToString()
+ "." + AppVersion.Minor.ToString()
+ "." + AppVersion.Build.ToString()
+ "." + AppVersion.Revision.ToString();
Response.Write("Version: " + MyVersion);

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by baylor | last post: by
9 posts views Thread by Abe Frohnman | last post: by
5 posts views Thread by Aaron | last post: by
1 post views Thread by Mark | last post: by
2 posts views Thread by Mark | last post: by
5 posts views Thread by cameron | last post: by
8 posts views Thread by S. HP | last post: by
3 posts views Thread by Michael Kellogg | last post: by
4 posts views Thread by moondaddy | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.