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

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 20 '05 #1
11 1899
1) was compiled against
2) is supposed to use
Once the assembly is loaded, you can use Assembly.ImageRuntimeVersion
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 20 '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 20 '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.org> wrote in message
news:eX**************@tk2msftngp13.phx.gbl...
1) was compiled against
2) is supposed to use


Once the assembly is loaded, you can use Assembly.ImageRuntimeVersion
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 20 '05 #4

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:eX**************@tk2msftngp13.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 incompatibilities between Framework versions that we
should be aware of and try to avoid?

TIA,
Phill W.
Nov 20 '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 20 '05 #6
Phill. W wrote:
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:eX**************@tk2msftngp13.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 incompatibilities 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
incompatibilities, but you could always try googling it.

--
Sven Groot

http://unforgiven.bloghorn.com

Nov 20 '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******************@TK2MSFTNGP09.phx.gbl...
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 20 '05 #8
Z D
Phil,

Yes! It is important! (IMO)

And there are incompatibilites! 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.org> wrote in message
news:eX**************@tk2msftngp13.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 incompatibilities between Framework versions that we
should be aware of and try to avoid?

TIA,
Phill W.

Nov 20 '05 #9
Z D
Sven,
not certain. I'm not certain an (exhaustive) list exists of any
incompatibilities, 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****************@TK2MSFTNGP09.phx.gbl... Phill. W wrote:
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:eX**************@tk2msftngp13.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 incompatibilities 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
incompatibilities, but you could always try googling it.

--
Sven Groot

http://unforgiven.bloghorn.com

Nov 20 '05 #10
ZD,

Please, /please/, *please*

- Is there a comparable list (even a preliminary one) for the change
over from Framework 1.1 to 2.0?

TIA,
Phill W.

"Z D" <NO****@NOSPAM.com> wrote in message
news:O9**************@TK2MSFTNGP12.phx.gbl...
Phil,

Yes! It is important! (IMO)

And there are incompatibilites! 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.org> wrote in message
news:eX**************@tk2msftngp13.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 incompatibilities between Framework versions that we
should be aware of and try to avoid?

TIA,
Phill W.


Nov 20 '05 #11
Z D
Phill,

I saw one floating around not too long ago, cant seem to find it. If I come
across it I will post it.

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

Please, /please/, *please*

- Is there a comparable list (even a preliminary one) for the change
over from Framework 1.1 to 2.0?

TIA,
Phill W.

"Z D" <NO****@NOSPAM.com> wrote in message
news:O9**************@TK2MSFTNGP12.phx.gbl...
Phil,

Yes! It is important! (IMO)

And there are incompatibilites! 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.org> wrote in message
news:eX**************@tk2msftngp13.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 incompatibilities between Framework versions that we
should be aware of and try to avoid?

TIA,
Phill W.



Nov 20 '05 #12

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: Michael Bøcker-Larsen | last post by:
Hi I'v been stuck on this problem for ages now. I have found that I'm not the only one with this problem, by looking through the different newsgroups. Hope you can help me! I know there is a...
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...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
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...
5
by: John A Grandy | last post by:
How to use the .NET Reflector to determine which .NET version and assembly was compiled in ?
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: 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...
0
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.