Confirming assembly framework

Topics: For MSBee Users
Jan 12, 2007 at 5:08 PM
We're in the process of transitioning from 1.1 to the 2.0 framework. We're not yet using 2.0-specific code. MSBee seems to work great in compiling the 2.0 code into 1.1 assemblies.

I simply want to confirm the assembly actually is compiled using the 1.1 framework. I used Ildasm but couldn't find anything jumping out at me.

Is there a reliable method of determining which framework an assembly was compiled with?

Thank you.
Jan 12, 2007 at 6:34 PM
You can check create and check MSBuild log files which will tell you the command line used to build the project.

You should see there which compiles were used to create assemblies.

Thanks,
Bertan
Jan 13, 2007 at 11:56 AM
Well there are two way I can think of. Firstly look at the version numbers of the referenced assemblies, look at the "mscorlib" reference it'll either be 1.0.5000 or 2.0.50727.

Secondly an Assembly has a field that includes "the major and minor version number of the CLR that the managed module was built for" 1, this can be accessed with the Assembly.ImageRuntimeVersion property, this returns "v1.1.4322" and "v2.0.50727". This may well be what Ildasm displays as the first line of the 'MANIFEST' page, i.e.
"// Metadata version: v1.1.4322
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 1:0:5000:0
}
...
"

Alan
Jan 15, 2007 at 3:00 PM
Thanks. Comparing mscorlib versions proved v1.1.