471,336 Members | 1,239 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,336 software developers and data experts.

Version Numbers

UJ
Here's a dumb question - how can I find out the version number of my program
in code. I don't want to have to manually set it every time. I'd like to be
able to get the version much like if you right click on the exe and go to
version.

TIA - Jeff.
Feb 13 '06 #1
3 1214
UJ <fr**@nowhere.com> wrote:
Here's a dumb question - how can I find out the version number of my program
in code. I don't want to have to manually set it every time. I'd like to be
able to get the version much like if you right click on the exe and go to
version.


Use AssemblyVersionAttribute to specify the version, and
Assembly.GetName().Version to retrieve it at runtime.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 13 '06 #2
Jeff,
You probably are looking for the AssemblyVersionAttribute from the
AssemblyInfo.cs class file. The MSDN documentation details this and how to
get at it at runtime:

http://msdn.microsoft.com/library/de...classtopic.asp

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"UJ" wrote:
Here's a dumb question - how can I find out the version number of my program
in code. I don't want to have to manually set it every time. I'd like to be
able to get the version much like if you right click on the exe and go to
version.

TIA - Jeff.

Feb 13 '06 #3
On Mon, 13 Feb 2006 13:21:30 -0800, "Peter Bromberg [C# MVP]"
<pb*******@yahoo.nospammin.com> wrote:

-> Jeff,
-> You probably are looking for the AssemblyVersionAttribute from the
-> AssemblyInfo.cs class file. The MSDN documentation details this
and how to
-> get at it at runtime:
->
->
http://msdn.microsoft.com/library/de...classtopic.asp
->
-> Peter
Peter, can you also set it at compile time, programmatically?
Feb 15 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Kevin R | last post: by
reply views Thread by Anders W. Pedersen | last post: by
3 posts views Thread by Shadow Lynx | last post: by
89 posts views Thread by Randy Webb | last post: by
15 posts views Thread by bg_ie | last post: by
14 posts views Thread by Phil | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.