1 Part .NET Developer, 2 Parts Personal Developer; 100% Canadian

Determine .NET Framework Version of an Application

I needed to find the version of .NET framework required for a vendor provided application in short order; there was no documentation (of course), the vendor was not available and the super user was not available.
Your typical support scenario.

When you try to run a .NET EXE on a computer that does not have the framework, your application informs you with a prompt along the lines of 'The Application Requires .NET framework version x.x'
If you have the framework installed, it does not prompt you (of course).

I figured it should be as easy as right clicking the EXE and selecting properties or something similar, but no.
The easiest way I found was by using the MSIL Disassembler ildasm.exe
If you have installed the 2.0 SDK you can find ILDASM.exe in this location

c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\ildasm.exe

The steps to get the .NET framework version are as follows:
1) Execute ILDASM.EXE from the SDK folder noted above
2) In ILDASM select the File | Open menu
3) Select the EXE or DLL you want to disassemble

ILDASM will now show you the file you selected in #3. You will want to double click the MANIFEST and it will load the manifest in a notepad-like editor.
The top line will read //Medata version: vX.X.XXXX
Where the X.X.XXXX is your .NET framework version.

See the image below

ILDASM.exe

Feedback

# re: Determine .NET Framework Version of an Application

I was searching for how to determine .net framework version needed for given application. Here I got very valuable information.
I need to know more about. Yeas there are versions of each and every assemblies using the application, I need to know how this really happens in the runtime. We know .Net application runs as JIT debugging. Is there ant possibility too run some application which use .Net framework 3.0 assemblies (Let say: But at some given running cycle it won't use those) on only .Net framework 2.0 installed environment.
Please Help me to clarify this.

Regards,
Manoj

10/6/2008 10:54 PM | Manoj Gamage

# re: Determine .NET Framework Version of an Application

I have a similar problem but it is for older versions of the framework; 2.0 DLL's will not work with 1.1 applications.

For your problem, it sounds like your can using the Multi-targeting feature in VS 2008.
I would suggest targetting the 2.0 framework in your VS 2008 project (for your 3.0 DLLs).
You can write your application with 3.x features, but the compiled code will target the framework specified.

ScottGu talks about it here
http://weblogs.asp.net/scottgu/archive/2007/06/20/vs-2008-multi-targeting-support.aspx

Hope this helps,
Gary 10/7/2008 8:00 AM | Gary Pronych

# re: Determine .NET Framework Version of an Application

I set everything to ToolsVersion=3.5 and I still see the same metadata version as if it were set to 2.0. Any insight into that? 10/8/2008 2:53 PM | John Baughman

# re: Determine .NET Framework Version of an Application

Maybe I should clarify a bit...

I have a command line build process that I set all the project files' Project tags ToolsVersion attribute to use 3.5 and it still shows the metadata version as 2.0. 10/8/2008 3:01 PM | John Baughman

# re: Determine .NET Framework Version of an Application

I think I figured it out.

This post helped a little: http://www.eggheadcafe.com/software/aspnet/31269155/how-to-determine-what-ver.aspx

What I determined was looking at my DLL it shows the metadata version: // Metadata version: v2.0.50727

And then later in the manifest, I see:
.assembly extern System.Web.Extensions
{
.publickeytoken = (31 BF 38 56 AD 36 4E 35 ) // 1.8V.6N5
.ver 3:5:0:0
}
Which tells me this DLL needs 3.5. 10/9/2008 11:45 AM | John Baughman





 

Please add 6 and 1 and type the answer here: