How to determine which clr version an assembly or executable is using

Let’s assume you have all (most) of the framework versions installed on your machine. How can you determine which application uses which framework version? Reminder: There is plenty of information about how to determine which framework version is installed. The question at hand, is about which framework version does an application actually use! Microsoft published an kb about  : For your information, here is a full list of version numbers:

!(/images/pavelka/howtodeterminewhichclrversionanassemblyorexecutableisusing/cdfd2739-clrver_thumb3.jpg)

However, most people just differentiate between v. 1.0/1.1 (what they mean is 1.1.4322.2032) and v 2.0 (which is 2.0.50727.42).

Now back to the original question. How can you determine what framework version an application uses?

There is an tool called clrver.exe which is shipped with the SDK for.Net 2.0, you can find the tool under C:\Programme\Microsoft Visual Studio 8\SDK\v2.0\Bin

If you use the clrver.exe tool without arguments you get the following output: **C:\Programme\Microsoft Visual Studio 8\VC>clrver.exe Versions installed on the machine: v2.0.50727 **You can use all / argument to get more detailed information. -all   - Displays all processes on the machine using the CLR. - Displays the version of the CLR used by the specified process.

Thus you can get detail information about the running processes.

3920    devenv.exe              v2.0.50727 2084    WebDev.WebServer.EXE    v2.0.50727 2944    Obab.UI.ProfessorenClientCab.vshost.exe v2.0.50727

Unfortunatley, you can only get the information from running applications. There is no way to let clrver.exe determine the required/used framework version from the application file itself.

Over at, you find an interesting  about the above topic and what is more important, you can even download a simple tool to determine the version information directly from a file.You pass that tool a filename and it outputs the Version information and what version of the CLR runtime the file requires. The source code for that tool can be found.

I wonder why clrver.exe does not supply this functionality out-of-the-box?

This article is part of the GWB Archives. Original Author: Hannes Pavelka

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.