Solved

C# executable version

Posted on 2004-10-04
4
286 Views
Last Modified: 2008-02-01
Hi,

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 0.0.0.0?  Also, how can I obtain the version at runtime?

Thank you,
Joe
0
Comment
Question by:joeslow
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
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
0
 
LVL 20

Assisted Solution

by:ihenry
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
0
 

Author Comment

by:joeslow
ID: 12226972
Hi,

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?

Thanks,
Joe
0
 

Author Comment

by:joeslow
ID: 12228543
Hi,

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.

Joe
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

679 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