Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2004

Tip: Looking for answers? Try searching our database.

Determine Assembly's .NET Framework Version

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Z D - 04 May 2004 15:10 GMT
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
Mattias Sj?gren - 04 May 2004 15:39 GMT
>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

Signature

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

Z D - 04 May 2004 15:50 GMT
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

> >1) was compiled against
> >2) is supposed to use
[quoted text clipped - 14 lines]
>
> Mattias
Sven Groot - 04 May 2004 17:20 GMT
> Hi Mattias,
>
[quoted text clipped - 11 lines]
>
> 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
}

Signature

Sven Groot

http://unforgiven.bloghorn.com

Z D - 05 May 2004 16:08 GMT
Sven,

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

-ZD

> > Hi Mattias,
> >
[quoted text clipped - 37 lines]
>   .ver 1:0:5000:0
> }
Phill.  W - 04 May 2004 17:07 GMT
. . .
> >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.
Sven Groot - 04 May 2004 17:22 GMT
Phill. W wrote:
> . . .
>>> 3) is compatible with?
[quoted text clipped - 7 lines]
>
> 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.

Signature

Sven Groot

http://unforgiven.bloghorn.com

Z D - 05 May 2004 16:13 GMT
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

> Phill. W wrote:
> > . . .
[quoted text clipped - 22 lines]
> not certain. I'm not certain an (exhaustive) list exists of any
> incompatibilities, but you could always try googling it.
Z D - 05 May 2004 16:12 GMT
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

> . . .
> > >3) is compatible with?
[quoted text clipped - 13 lines]
> TIA,
>     Phill  W.
Phill.  W - 06 May 2004 12:59 GMT
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.

> Phil,
>
[quoted text clipped - 30 lines]
> > TIA,
> >     Phill  W.
Z D - 07 May 2004 18:17 GMT
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

> ZD,
>
[quoted text clipped - 42 lines]
> > > TIA,
> > >     Phill  W.
Sven Groot - 04 May 2004 15:51 GMT
> 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.

Signature

Sven Groot

http://unforgiven.bloghorn.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.