How to detect installed CLR versions and how they are used…

It has been a while since I posted anything on my blog. Sorry for keeping you on hold ;) ! I think the blog will be filled with some information shortly, since I am still overthinking all the great stuff I saw on Tech-Ed North America a couple of weeks ago (first I had to overcome the jetlag, then the weather in The Netherlands, etc. etc. :) ). Enough nonsense for now!

While attending a session by Scott Hanselman on everything new in .NET 4.0 he showed a wonderful small tip, not only useful for the few of us already working on Visual Studio 2010: when working in the VS.NET Command Prompt, there is a small but useful command called ‘CLRVER’. It shows all .NET versions installed on your computer. Also, as an addition to this command, you can show active runtime processes using the -all switch. Nice piece of code! Enjoy!

2 thoughts on “How to detect installed CLR versions and how they are used…

  1. SpamBlazer Technologies

    @Jaap Trouwborst

    The reason why you saw the appropriate .NET 4 installation using VS2010 command prompt; is because the tools are dependent on the .NET Framework that you are using. Each of the .NET Frameworks (.NET 2.0, .NET 3.0 .NET 3.5 and .NET 4.0) comes with their concomitant directory of Tools. For example, if a user downloads the current Windows SDK version 7.1; it comes with two versions of clrver. There is one for .NET 3.5 Framework and another for the .NET 4.0 Framework. You would find them respectively in the following directories depending on your installation directory

    a. C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\
    b. C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\NETFX 4.0 Tools

    So in your case, for VS2010, you were seeing the clrver from the following directory

    c. C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools

    SpamBlazer Technologies

  2. Jaap Trouwborst

    Well, I just tried it.
    On my development machine running Windows Vista and all .NET frameworks above v2.0 installed, this command only returns that v2.05727 is installed…

    Can you explain this?

    Ah, when I try this command using the VS2010 command prompt, it did also return that .NET 4.0 is installed.

Comments are closed.