473,625 Members | 3,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 programmaticall y 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 4723
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
programmaticall y 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.Reflecti on.Assembly.Get ExecutingAssemb ly().ImageRunti meVersion;

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.33 00.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******** ***********@new sread1.news.pas .earthlink.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
programmaticall y 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.Reflecti on.Assembly.Get ExecutingAssemb ly().ImageRunti meVersion;

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
2877
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 that applies to all these events, but I need to have specific code execute when the form closes. The properties for this method are sender (the originator) and e (event arguments). I know how to get typeof (sender) to determine what form or...
4
6569
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
3426
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 will extract this info somehow?
3
1713
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 upgraded me twice. I'd like my software to be proactive and tell me about it next time they do it. Is there an object that exposes the framework's version?
1
1360
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 gives the version of the framework that the assembly was built on.
5
4592
by: John A Grandy | last post by:
How to use the .NET Reflector to determine which .NET version and assembly was compiled in ?
0
5754
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 error occurred with only v1.1 installed. I also got the same error when trying to install an old ACAD 2005 version (as a check). I have successfully installed this version a couple of years ago.
1
2350
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
7615
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 (File.Exists(path)) - but for an assembly, of a particular version, etc in the GAC. I have googled this and failed to find anything useful. Thanks
0
8256
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8694
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6118
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4193
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1500
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.