Home All Groups Group Topic Archive Search About

dynamically determine .net baseframework version of exe or dll

Author
26 Nov 2006 6:45 PM
Anthony LaMark
Hi All,

Whether in a Winform application (.exe) or a .Net assembly (.dll), is there
a way to determine what version of the .net baseframework the run-time
module (i.e. exe or dll) was loaded with (is using)?  Seems that using
reflection this is possible...just can't seem to figure out what
classes/instances will get me there.  Thanks in advance!

Tony

Author
26 Nov 2006 7:25 PM
Mattias Sjögren
Anthony,

>Whether in a Winform application (.exe) or a .Net assembly (.dll), is there
>a way to determine what version of the .net baseframework the run-time
>module (i.e. exe or dll) was loaded with (is using)?

System.Environment.Version


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Author
28 Nov 2006 12:18 AM
Gabriel Lozano-Morán
If you are looking for a non-programmatic way you can enable CLR Load
Logging which I blogged about
http://pointerx.net/blogs/glozano/archive/2006/03/23/84.aspx

Gabriel Lozano-Morán

Show quote
"Anthony LaMark" <anth***@eXcSoftware.com> wrote in message
news:OiNVusYEHHA.992@TK2MSFTNGP03.phx.gbl...
> Hi All,
>
> Whether in a Winform application (.exe) or a .Net assembly (.dll), is
> there a way to determine what version of the .net baseframework the
> run-time module (i.e. exe or dll) was loaded with (is using)?  Seems that
> using reflection this is possible...just can't seem to figure out what
> classes/instances will get me there.  Thanks in advance!
>
> Tony
>
Author
28 Nov 2006 3:49 PM
Duggi
Hi

The framework library, that includes .exes and .dlls, (eg :say
System.dll) are .net assemblies.... So you can always query the
metadata of assebmly through reflection.

hope this is helpful

Thanks
-Cnu


Anthony LaMark wrote:
Show quote
> Hi All,
>
> Whether in a Winform application (.exe) or a .Net assembly (.dll), is there
> a way to determine what version of the .net baseframework the run-time
> module (i.e. exe or dll) was loaded with (is using)?  Seems that using
> reflection this is possible...just can't seem to figure out what
> classes/instances will get me there.  Thanks in advance!
>
> Tony

AddThis Social Bookmark Button