473,327 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 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 1274
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sherman Willden | last post by:
I am trying to use Perl's XML::Twig to modify a version number in an XML document. At the very end of this posting is an excerpt from the xml document. Just before the xml excerpt is the Perl code...
2
by: Kevin R | last post by:
Hi All, I need to establish that the machine on which my user intends to run my program is at least .Net version 1.1 SP2 and am having a little trouble figuring out how to do this. I don't...
0
by: Willem | last post by:
Based on MK's TSI_SOON (http://www.trigeminal.com/)I've created a nifty little procedure that - whenever you compact you db you get an incremental backup copy. Given that you have a table with...
0
by: Anders W. Pedersen | last post by:
Hi there! I'm working on a medium-sized .NET web application written in c#. We are using Visual Studio 2003 for development and Visual Source Safe as our code repository. Occasionally, we do a...
3
by: Shadow Lynx | last post by:
At the bottom of the default Error page that appears when Unhandled Exceptions occur, what exactly is the difference between the "Microsoft ..Net Framework Version" and the "ASP.NET Version"? I...
1
by: theWizard1 | last post by:
Using Asp.NET 2.0. I published my web application to the server using the publish to website feature of asp.net 2.0. In VS.Net 2005 IDE, on solution explorer, at top level just below solution, I...
89
by: Randy Webb | last post by:
There is an updated version of the FAQ at: <URL: http://jibbering.com/faq/newfaq/> The changes/modifications to date are: 2.3 Corrected "span" to "spam". 2.3 Updated with a note about not...
15
by: bg_ie | last post by:
Hi, I have the following class - class TestOutcomes: PASSED = 0 FAILED = 1 ABORTED = 2 plus the following code -
2
by: Birky | last post by:
Can someone point me in the right direction on how to use Version Numbers within Access? I have a database were its primary goal is to track the versions of several projects. Since the version...
14
by: Phil | last post by:
I have been using this code to display the version number, and this has worked well, but I am now changing from using the ClickOnce publishing to a proper setup project, and this no longer works. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.