This is a general question which people ask when they try to run an application build in the newer version of .NET Framework than the .NET Framework they currently have in their Computer. So here is a small trick you can use to find all the .NET Versions listed which are currently installed in your Computer.
Instructions:
- Using Registry
- Open your Registry Editor by typing regedit in Start menu search box.
- In the Registry Editor Move to the following location
HKEY_LOCAL_MACHINE–>SOFTWARE–>MICROSOFT->.NETFRAMEWORK - This Key in Registry Editor has a number of folders listed, one each for every .NET Framework version you have installed in your Computer.
- If your Registry Editor does not have the above Location, then try the following location
HKEY_LOCAL_MACHINE–>SOFTWARE–>MICROSOFT->NET FRAMEWORK SETUP/NDP
- Using Visual Studio Command Prompt
- If you have installed the latest .NET Framework, then you can find a Visual Studio Command Prompt, which is available from the Visual Studio Tools folder which can be used to compile our Code files.
- You can find the Visual Studio Command Prompt in the following directory
- For .NET Framework 4.0 or Later
Start –> All Programs –> Microsoft Visual Studio –> Visual Studio Tools, and then click Visual Studio Command Prompt - For Earlier Version Of .NET Framework
Start –> All Programs –> Microsoft Visual Studio –> Visual Studio Tools, and then click Visual Studio Command Prompt. (Only if you have Visual Studio 2005 or later is installed)
or
Start –> All Programs –> Microsoft .NET Framework SDK v2.0, and then click SDK Command Prompt. (Only if you have .NET Framework 2.0 or higher is installed)
- For .NET Framework 4.0 or Later
- If we just type csc in that Visual Studio Command Prompt and hit Enter, It will give an error and also tell us about the Latest .NET Framework installed in the machine.
- Using C# Code
- You don’t need to have Visual Studio installed too use this method. Just open any text editor like Notepad and add the following code in it.
using System;
class Version
{
public static void Main()
{
Console.WriteLine();
Console.WriteLine("Latest .Net Framework Version is {0}", Environment.Version.ToString());
}
} - Now save this file with the any name but extension must be “.cs” and you must select “All Files” in the “Save As Type:” box while saving the file. I am saving this file with the name “Framework.cs” in D:\ directory.

- Now open the Visual Studio Command Prompt which I had described in the 2nd method.
- Move to the directory where you have saved the file, in my case, it is in D:\ directory.
- Type the following command in there and hit Enter, It will compile your file and make a .exe file from it.
csc Framework.cs - It might give you a warning but don’t worry it will compile your file correctly.
- Now type just Framework.exe there and hit Enter. It will show you the Framework Version as output of the program.

- You don’t need to have Visual Studio installed too use this method. Just open any text editor like Notepad and add the following code in it.
Incoming search terms:
- determine net version (1)
- find net framework in registry c# (1)