467,907 Members | 1,457 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,907 developers. It's quick & easy.

How to determine which version of .NET Framework any given assembly is built with?

Hi,

Is there a way to determine which version of .NET Framework any given
assembly is built with?

thanks!
-Yasutaka

Jul 21 '05 #1
  • viewed: 6074
Share:
4 Replies
Is there a way to determine which version of .NET Framework any given
assembly is built with?


Check Assembly.ImageRuntimeVersion or the version of Mscorlib.dll it
references.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jul 21 '05 #2
> Is there a way to determine which version of .NET Framework any given
assembly is built with?


If you're trying to do it within code you can use:

System.Environment.Version.ToString()

--
Thanks, Jeff
Jul 21 '05 #3
Thanks Mattias,

The Assembly.ImageRuntimeVersion did it.

-Yasutaka
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:Ob**************@TK2MSFTNGP12.phx.gbl...
Is there a way to determine which version of .NET Framework any given
assembly is built with?


Check Assembly.ImageRuntimeVersion or the version of Mscorlib.dll it
references.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


Jul 21 '05 #4
That would give you the version of the runtime that was currently
executing... not what version the assemblu was built with.

If you wanted to do this from unmanaged code, you can call the function
GetFileVersion found in mscoree.dll.

Tim
--------------------
| Reply-To: "Jeff B." <je**@nowhere.com>
| From: "Jeff B." <je**@nowhere.com>
| References: <Oz**************@TK2MSFTNGP12.phx.gbl>
| Subject: Re: How to determine which version of .NET Framework any given
assembly is built with?
| Date: Thu, 12 Feb 2004 12:46:21 -0600
| Lines: 11
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <eS**************@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: webhost1.nngco.com 216.58.237.20
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTN GXA05.phx.gbl!TK2MSFTNGP08
..phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.general:124495
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| > Is there a way to determine which version of .NET Framework any given
| > assembly is built with?
|
| If you're trying to do it within code you can use:
|
| System.Environment.Version.ToString()
|
| --
| Thanks, Jeff
|
|
|

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Alexander Baranovsky | last post: by
5 posts views Thread by John A Grandy | last post: by
7 posts views Thread by Aleksander Oven | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.