473,396 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
4 6528
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ken Durden | last post by:
I'm hoping to develop a build process which only increments the version number of an assembly when either its contents or one of its dependencies has changed. Our assembly structure translates...
2
by: Scott | last post by:
Does anyone know of a way to get the .NET Framework version that's required by a specified assembly. I have a program I've written that creates a Windows Installer setup for any application....
1
by: tamarana | last post by:
Once I redirect an assembly to run on a different framework than that it was complied on, how do I get the version of the framework that the assembly is executing on. System.Environment.Version...
9
by: Alexander Baranovsky | last post by:
Hello friends, How I can determine full path of Microsoft.Basic.dll? Thanks, Alexander
4
by: Yasutaka Ito | last post by:
Hi, Is there a way to determine which version of .NET Framework any given assembly is built with? thanks! -Yasutaka
0
by: Felix | last post by:
Ok, I've had this issues since yesterday and I cannot figure out what's causing it. Basically, I have a Visual Studio 2005 Web Service. The service runs completely find on my local development...
5
by: John A Grandy | last post by:
How to use the .NET Reflector to determine which .NET version and assembly was compiled in ?
7
by: Aleksander Oven | last post by:
Hi, I'm building a native application that will host managed 3rd-party assemblies. Before loading each assembly, I'd like to check if the required CLR and .NET version are present, and display a...
1
by: Michael Bray | last post by:
Sorry for the post here, but I have a quick need - I have a DLL that I don't know what version of the framework it was built under. How can I determine that with standard tool. Thanks! -mdb
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.