How do I find the .NET version used in an existing project?

20,039

Solution 1

The tag in the project file is <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>.

Alternatively under project properties: enter image description here

If it is a web application, you can find it under Web.config: <compilation targetFramework="4.0">

Solution 2

Check Your Web Config file.

In webconfig under <system.web>

<httpRuntime targetFramework="4.5" />
<compilation debug="false" targetFramework="4.5" />

this targetFramework is version

Solution 3

You can check .NET version of your project with the help of <TargetFrameworkVersion> tag in your .csproj file.

You can open .csproj form here: Right click on project => Open Folder in File Explorer => open .csproj in text editor.

Share:
20,039
SNag
Author by

SNag

Updated on July 19, 2022

Comments

  • SNag
    SNag almost 2 years

    I am expected to continue development on a C#/ASP.NET project that has changed hands multiple times, and no one person is sure which version of .NET is being used.

    Is there something (perhaps an option in Project properties or elsewhere) that tells me which version of .NET the project uses?

    EDIT :

    The project's hosted on a remote server (an ancient one!) which runs on Windows Server 2003, and uses Visual Studio 2005. I checked the Web.config file, and under <system.web>, I found <compilation debug="true"> but no entry for targetFramework !
    Does the existence of this entry depend on the .NET version too? Is this 2.x or older?

  • SNag
    SNag over 11 years
    Check my edit; I didn't find targetFramework anywhere in Web.config! Also, my Project properties doesn't quite look the same, as I'm using VS 2005.
  • khellang
    khellang over 11 years
    In the <compilation> tag, do you have any assemblies added? Like this: <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>. You could also try to check the .Net version of IIS' ApplicationPool, which the application runs in. Check out this blog post by @ScottHanselman, it might give you some help.
  • SNag
    SNag over 11 years
    Yes, I found 4 assemblies under <compilation>, two (System.Design and System.Windows.Forms) having Version=2.0.0.0 and two (System.Web.Extensions and System.Web.Extensions.Design) having Version=1.0.61025.0. I guess this answers my question. Thanks!