473,624 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Determine Assembly's .NET Framework Version

Z D
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?

thanks!
-ZD
Nov 16 '05 #1
11 3425
1) was compiled against
2) is supposed to use
Once the assembly is loaded, you can use Assembly.ImageR untimeVersion
to check the runtime version ot was complied against (stored in the
metadata header).

Most assemblies will also reference the version of Mscorlib.dll that
was included in that runtime version, so you can also check the
assembly's references with a tool such as ILDASM.

3) is compatible with?


It would be hard to provide a tool that could prove an assembly to be
compatible with a certain version. Better to test it or ask the
vendor.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2
Z D wrote:
3) is compatible with?


You should check for an App.Config file, see if it says anything. If not,
assume it's only compatible with the version it was compiled against.

--
Sven Groot

http://unforgiven.bloghorn.com

Nov 16 '05 #3
Z D
Hi Mattias,

Thanks for your reply.

I tried using ILDASM and looked at the manifest.

For an assembly known to be using .NET v1.1, I get this for mscorlib:
..assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) //
..z\V.4..
.ver 1:0:5000:0
}

What is version 1:0:5000:0 ??

If I go to mscorlib.dll and look at its file version, it says: 1.1.4322.573

So why doesn't ILDASM show this too?

thanks
-ZD
"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:eX******** ******@tk2msftn gp13.phx.gbl...
1) was compiled against
2) is supposed to use


Once the assembly is loaded, you can use Assembly.ImageR untimeVersion
to check the runtime version ot was complied against (stored in the
metadata header).

Most assemblies will also reference the version of Mscorlib.dll that
was included in that runtime version, so you can also check the
assembly's references with a tool such as ILDASM.

3) is compatible with?


It would be hard to provide a tool that could prove an assembly to be
compatible with a certain version. Better to test it or ask the
vendor.

Mattias

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

Nov 16 '05 #4

"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:eX******** ******@tk2msftn gp13.phx.gbl...
.. . .
3) is compatible with?


It would be hard to provide a tool that could prove an assembly to be
compatible with a certain version. Better to test it or ask the
vendor.


Mattias,
(Probably a silly question, but...)

Does it actually matter?

Are there any incompatibiliti es between Framework versions that we
should be aware of and try to avoid?

TIA,
Phill W.
Nov 16 '05 #5
Z D wrote:
Hi Mattias,

Thanks for your reply.

I tried using ILDASM and looked at the manifest.

For an assembly known to be using .NET v1.1, I get this for mscorlib:
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
// .z\V.4..
.ver 1:0:5000:0
}

What is version 1:0:5000:0 ??
It's the version of mscorlib.dll.
If I go to mscorlib.dll and look at its file version, it says:
1.1.4322.573
The file version you see in explorer is determined by an old-style Win32
VERSION_INFO resource. It is separate from the version defined in the
assembly manifest. The VB.NET and C# compilers by default emit a
VERSION_INFO resource that mirrors the assembly version info. It is
perfectly possible to add in a Win32 resource file yourself during
compilation time, in which case the compiler will not generate this info. So
the two version numbers need not match. And in the case of most of the
Framework Class Library files, they don't. Why MS chose to do this I don't
know.
So why doesn't ILDASM show this too?


ILDASM knows nothing about Win32 resources, and the .Net assembly loader
doesn't either. If you open mscorlib.dll in ILDASM, you'll see the assembly
version defined in its manifest is in fact 1:0:5000:0:

..assembly mscorlib
{
.ver 1:0:5000:0
}

--
Sven Groot

http://unforgiven.bloghorn.com

Nov 16 '05 #6
Phill. W wrote:
"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:eX******** ******@tk2msftn gp13.phx.gbl...
. . .
3) is compatible with?
It would be hard to provide a tool that could prove an assembly to be
compatible with a certain version. Better to test it or ask the
vendor.


Mattias,
(Probably a silly question, but...)

Does it actually matter?


Yes.
Are there any incompatibiliti es between Framework versions that we
should be aware of and try to avoid?


The .Net Framework 1.1 should be mostly backward compatible with 1.0.
Forward compatibility only holds as long as you don't use anything that's
exclusive to the 1.1 version.

However, there are some changes I believe that can cause an application to
malfunction. I believe there are some in the Xml and Xslt classes, but I'm
not certain. I'm not certain an (exhaustive) list exists of any
incompatibiliti es, but you could always try googling it.

--
Sven Groot

http://unforgiven.bloghorn.com

Nov 16 '05 #7
Z D
Sven,

Thank's very much for your response. I get it now! :)

-ZD

"Sven Groot" <sv*******@gmx. net> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
Z D wrote:
Hi Mattias,

Thanks for your reply.

I tried using ILDASM and looked at the manifest.

For an assembly known to be using .NET v1.1, I get this for mscorlib:
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
// .z\V.4..
.ver 1:0:5000:0
}

What is version 1:0:5000:0 ??
It's the version of mscorlib.dll.
If I go to mscorlib.dll and look at its file version, it says:
1.1.4322.573


The file version you see in explorer is determined by an old-style Win32
VERSION_INFO resource. It is separate from the version defined in the
assembly manifest. The VB.NET and C# compilers by default emit a
VERSION_INFO resource that mirrors the assembly version info. It is
perfectly possible to add in a Win32 resource file yourself during
compilation time, in which case the compiler will not generate this info.

So the two version numbers need not match. And in the case of most of the
Framework Class Library files, they don't. Why MS chose to do this I don't
know.
So why doesn't ILDASM show this too?
ILDASM knows nothing about Win32 resources, and the .Net assembly loader
doesn't either. If you open mscorlib.dll in ILDASM, you'll see the

assembly version defined in its manifest is in fact 1:0:5000:0:

.assembly mscorlib
{
.ver 1:0:5000:0
}

--
Sven Groot

http://unforgiven.bloghorn.com

Nov 16 '05 #8
Z D
Phil,

Yes! It is important! (IMO)

And there are incompatibilite s! Alot of them! I was bitten pretty hard when
I migrated from v1.0 to v1.1. Luckily it wasn't anything major and it was
only in a test environment (I just had to stay up until all hours of the
morning fixing the issues since I hadn't planned for any!)

Here's a good list of all the changes that will break your application when
moving from v1.0 to v1.1:

http://www.gotdotnet.com/team/changeinfo/default.aspx
Hope it helps,
-ZD

"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:c7******** **@yarrow.open. ac.uk...

"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:eX******** ******@tk2msftn gp13.phx.gbl...
. . .
3) is compatible with?


It would be hard to provide a tool that could prove an assembly to be
compatible with a certain version. Better to test it or ask the
vendor.


Mattias,
(Probably a silly question, but...)

Does it actually matter?

Are there any incompatibiliti es between Framework versions that we
should be aware of and try to avoid?

TIA,
Phill W.

Nov 16 '05 #9
Z D
Sven,
not certain. I'm not certain an (exhaustive) list exists of any
incompatibiliti es, but you could always try googling it.
Here's a pretty exhaustive (if not complete) list of changes that will break
an ap in both directions:
http://www.gotdotnet.com/team/changeinfo/default.aspx

-ZD

"Sven Groot" <sv*******@gmx. net> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. .. Phill. W wrote:
"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:eX******** ******@tk2msftn gp13.phx.gbl...
. . .
3) is compatible with?

It would be hard to provide a tool that could prove an assembly to be
compatible with a certain version. Better to test it or ask the
vendor.


Mattias,
(Probably a silly question, but...)

Does it actually matter?


Yes.
Are there any incompatibiliti es between Framework versions that we
should be aware of and try to avoid?


The .Net Framework 1.1 should be mostly backward compatible with 1.0.
Forward compatibility only holds as long as you don't use anything that's
exclusive to the 1.1 version.

However, there are some changes I believe that can cause an application to
malfunction. I believe there are some in the Xml and Xslt classes, but I'm
not certain. I'm not certain an (exhaustive) list exists of any
incompatibiliti es, but you could always try googling it.

--
Sven Groot

http://unforgiven.bloghorn.com

Nov 16 '05 #10

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

Similar topics

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
2
4723
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. 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...
4
1449
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
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
8249
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
8685
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
8633
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
8348
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7176
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4084
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
4187
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1797
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1493
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.