views:

251

answers:

1

I have a reference to a type, for which I would like to retrieve the version number of the Assembly in which it is located.

What is the best way to do this?

+11  A: 

x.GetType().Assembly.GetName().Version

ckarras
If you want to access the currently executing assembly use Assembly.GetExecutingAssembly().GetName().Version.
kronoz