Discover which version of framework an assembly is compiled against

Hi everyone

One of my friends has emailed me a .net assembly and I want to find out which version of the .net framework it's compiled against. Is there a tool that I can use to find out if the assembly was compiled using framework 1.1 or framework 2.0?

Also if the assembly was compiled against version 2, is there a tool that will allow me to down compile to version 1.1 (assuming that no 2.0 specific code is being used)?

Regards
brimfulAsked:
Who is Participating?
 
bruintjeCommented:
Hi brimful,
----------

you could use ILDASM to determine the mscorlib dll version

for basic ILDASM usage
http://msdn.microsoft.com/msdnmag/issues/01/05/bugslayer/

--
for .net 1.1 it returns something like

 .assembly extern mscorlib
{
  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         //
.z\V.4..
  .ver 1:0:5000:0

}

for .net 1.0 it was  ver 1.0.3300

for .net 2.0 i'm not sure though but i assume it would start with 2.0 ;-)
--

----------
bruintje
share what you know, learn what you don't
0
 
brimfulAuthor Commented:
and how would I down compile the assembly from 2.0 to 1.1 or use a 2.0 assembly with 1.1 (assuming that the assembly doesn't have any 2.0 specific code)?

0
 
bruintjeCommented:
as far as i know you can't without having the source code

there are decompilers around but i think they only show you the source not give you back files needed to recompile for another version of the framework

if it's build for 2.0 then it will only run on 2.0 framework this is how its build by Microsoft, only if you can get the source you can compile it yourself for 1.1 in a new project

what you can do is install version of the framework besides 1.1 and work with the 2.0 assembly in a new 2.0 project but you can't mix them up in one project
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
bruintjeCommented:
should've been

what you can do is install version 2.0 of the framework besides 1.1 and work with the 2.0 assembly in a new 2.0 project but you can't mix them up in one project
0
 
brimfulAuthor Commented:
ok just ran ildasm. Assembly is compiled against version 2.0 :(

Hmm looks like I'll need to upgrade to vs 2005 or get provider to down compile to version 1.1
0
 
bruintjeCommented:
yeah thats sad indeed, forgot that if you want to use 2.0 you also need to upgrade the IDE or use the Express version which i haven't tried running side by side with VS 2003
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.