Solved

C# executable version

Posted on 2004-10-04
4
282 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now