How can I obtain the value of AssemblyVersion attribute

R

Riccardo Fersini

Can someone tell me about this question: "how can I obtain AssemblyVersion
attribute within my VB code in compactframework."

Thanks in advance
 
J

Jon Skeet

Riccardo Fersini said:
Can someone tell me about this question: "how can I obtain AssemblyVersion
attribute within my VB code in compactframework."

Use Assembly.FullName.Version.
 
R

Riccardo Fersini

Dear Jon,

I did not understand what you wrote to me.

Can you be more accurate in your response please....

I don't think that your code will work correctly in .net framework neither
in .net compact framework.
 
P

Peter Foot [MVP]

This should do it:-

add:-

Imports System.Reflection

to the top of your code file, then:-

Assembly.GetExecutingAssembly().GetName().Version.ToString()

This will get you the version of the assembly in which this code is placed.
If you want to get the version of another assembly used in your program look
at the Assembly.Load() method. All of this functionality can be found in the
System.Reflection namespace.

Peter

--
Peter Foot
Windows Embedded MVP

In The Hand
http://www.inthehand.com
Handheld Interactive Reference Guides

Riccardo Fersini said:
Dear Jon,

I did not understand what you wrote to me.

Can you be more accurate in your response please....

I don't think that your code will work correctly in .net framework neither
in .net compact framework.
 
N

Neil Cowburn [MVP]

You can use Reflection to do this:

string Version =
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString
();

HTH
Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top