C# executable version

Posted on 2004-10-04
Last Modified: 2008-02-01

I am using VS 2003 to write a C# smart device application.  What do I have to do so that when I check the properties of the exe generated, I can see a version number other than  Also, how can I obtain the version at runtime?

Thank you,
Question by:joeslow
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 13

Accepted Solution

BlackTigerX earned 125 total points
ID: 12223564
look at the assemblyInfo.cs (in the solution explorer) file of your project, you'll see all the information you need there, and it explains how to activate it
LVL 20

Assisted Solution

ihenry earned 125 total points
ID: 12223673
Try this,

System.Version ver = Assembly.GetExecutingAssembly().GetName().Version;
int b = ver.Build;      // 1740
int m = ver.Major;      // 1
int n = ver.Minor;      // 0
int r = ver.Revision;      // 21027
string verNum = ver.ToString();      // 1.0.1740.21027

Author Comment

ID: 12226972

I can see the AssemblyInfo.cs in a normal desktop application but not on my smart device application (.netcf).  Any ideas on how to do it there?


Author Comment

ID: 12228543

Thanks for your help.  I ended up just copying an AssemblyInfo.cs from another project to the .netcf one and added it.  Then I can set the version info there.


Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question