473,320 Members | 2,048 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,320 software developers and data experts.

Determine Framework version from assembly

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. However, for many of the
programs I work with there are a lot of files that have come from other
developers, and I'd like to be able to determine programmatically which
version of the Framework is required by each assembly. This way I'll know
which version to distribute with the installation.

I can load an assembly and get all of the referenced assemblies and
properties, but I just can't find a way to get the version of the Framework
it was built with.

Any help would be appreciated....

Scott
Nov 20 '05 #1
2 4707
Scott wrote:
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. However, for
many of the programs I work with there are a lot of files that have
come from other developers, and I'd like to be able to determine
programmatically which version of the Framework is required by each
assembly. This way I'll know which version to distribute with the
installation.

I can load an assembly and get all of the referenced assemblies and
properties, but I just can't find a way to get the version of the
Framework it was built with.

Any help would be appreciated....

Scott


string version =
System.Reflection.Assembly.GetExecutingAssembly(). ImageRuntimeVersion;

The property is in Framework 1.1 only.

- Pete
Nov 20 '05 #2
Thanks, but that's what I was afraid of. I'm working with VS2002 at work so
I don't have access to the 1.1 Framework. Does anyone know of another way
this can be done even if it doesn't involve Framework calls? When I open an
assembly in a text editor I see the following string in several places
"version=1.0.3300.0" referencing mscorlib and other assemblies such as
System.Drawing. Is there any way to get this information without having to
parse the file until I come upon this string?

Thanks...

Scott
"AirPete" <x@x.x> wrote in message
news:XJ*******************@newsread1.news.pas.eart hlink.net...
Scott wrote:
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. However, for
many of the programs I work with there are a lot of files that have
come from other developers, and I'd like to be able to determine
programmatically which version of the Framework is required by each
assembly. This way I'll know which version to distribute with the
installation.

I can load an assembly and get all of the referenced assemblies and
properties, but I just can't find a way to get the version of the
Framework it was built with.

Any help would be appreciated....

Scott


string version =
System.Reflection.Assembly.GetExecutingAssembly(). ImageRuntimeVersion;

The property is in Framework 1.1 only.

- Pete

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
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
11
by: Z D | last post by:
Hello, If I have a .NET assembly, how do I determine what version of the .NET framework it.... 1) was compiled against 2) is supposed to use 3) is compatible with? Is there a utility that...
3
by: Ken Stealth | last post by:
Hi, Is there a way to obtain the version of .net that my application is riding on (on the server). My app isn't tested nor does it run 100% on V1.1 and for some reason my service provided has...
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...
5
by: John A Grandy | last post by:
How to use the .NET Reflector to determine which .NET version and assembly was compiled in ?
0
by: Benny | last post by:
I have been trying to instal AutoCAD 2008 on a single PC and get the following Microsoft .NET Framework security error. I have updated to the latest .NET Framework 2.0 software, however, this...
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
7
by: Cramer | last post by:
I'm wondering if there is an easy way to programmatically determine if an assembly is installed in the GAC. This would be similar to our ability to easily determine if a file exists...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.