17

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
  • 17,681
  • 10
  • 54
  • 69
  • 1
    A diff SO question with more detailed answers: http://stackoverflow.com/questions/3231632/how-to-find-the-net-framework-version-of-a-visual-studio-project – user3820303 Apr 17 '17 at 08:21

4 Answers4

19

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">

khellang
  • 17,550
  • 6
  • 64
  • 84
  • 1
    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. – SNag Jan 18 '13 at 13:27
  • 1
    In the `` tag, do you have any assemblies added? Like this: ``. You could also try to check the .Net version of IIS' ApplicationPool, which the application runs in. Check out [this blog post](http://www.hanselman.com/blog/HowToSetAnIISApplicationOrAppPoolToUseASPNET35RatherThan20.aspx) by @ScottHanselman, it might give you some help. – khellang Jan 18 '13 at 16:02
  • Yes, I found 4 assemblies under ``, 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! – SNag Jan 20 '13 at 18:23
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

Harshit Tailor
  • 3,261
  • 6
  • 27
  • 40
1

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.

Ram Ch. Bachkheti
  • 2,609
  • 2
  • 17
  • 14
0

You can found it in Project Properties or retrieve it at run-time with Environment.Version().

Didac Perez Parera
  • 3,734
  • 3
  • 52
  • 87