Read the product version

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<p align=left><font face=Arial size=2>Hi</font>
<p align=left> 
<p align=left>I have a WPF/C# application (VS 2008/.NET 3.5).  I want to display the version of the executable (e.g. 1.2.0.15) in the status bar.  However, I cant find how to read this information....
 
<p align=left>The information Im after is in the AssemblyInfo.cs file: <font size=1>
<blockquote dir=ltr style="margin-right:0px
[</font><font color="#0000ff" size=1>assembly</font><font size=1>: </font><font color="#2b91af" size=1>AssemblyVersion</font><font size=1>(</font><font color="#a31515" size=1>"3.3.2.1"</font><font size=1>)]
[</font><font color="#0000ff" size=1>assembly</font><font size=1>: </font><font color="#2b91af" size=1>AssemblyFileVersion</font><font size=1>(</font><font color="#a31515" size=1>"3.1.2.3"</font><font size=1>)] </blockquote></font>
<p align=left> 
<p align=left>I want to display the AssemblyFileVersion number.  I can find the AssemblyVersion details in the string: <font color="#2b91af" size=1>
<blockquote dir=ltr style="margin-right:0px
Application</font><font size=1>.ResourceAssembly.FullName </blockquote></font>
<p align=left>but not the AssemblyFileVersion.
<p align=left> 
<p align=left>In VB.NET, the data was in <font color="#0000ff" size=1>
<blockquote dir=ltr style="margin-right:0px
My</font><font size=1>.Application.Info<font size=1>.Version.ToString </blockquote></font></font>
<p align=left>but there doesnt seem to be an equivalent in C# (well, I cant find it....)
<p align=left> 
<p align=left>Any help much appreciated!
<p align=left> 
<p align=left>Griff
<p align=left> 

View the full article
 


Write your reply...

Similar threads

D
Replies
0
Views
110
Donald Uko
D
K
Replies
0
Views
237
Khan345
K
K
Replies
0
Views
106
kapil kumar velpuri
K
J
Replies
0
Views
96
JuanC_LopGar97
J
Back
Top