How do I find the .NET version used in an existing project?
Solution 1
The tag in the project file is <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
.
Alternatively under project properties:
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.
SNag
Updated on July 19, 2022Comments
-
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 fortargetFramework
!
Does the existence of this entry depend on the .NET version too? Is this 2.x or older? -
SNag over 11 yearsCheck my edit; I didn't find
targetFramework
anywhere inWeb.config
! Also, my Project properties doesn't quite look the same, as I'm using VS 2005. -
khellang over 11 yearsIn 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 over 11 yearsYes, I found 4 assemblies under
<compilation>
, two (System.Design
andSystem.Windows.Forms
) havingVersion=2.0.0.0
and two (System.Web.Extensions
andSystem.Web.Extensions.Design
) havingVersion=1.0.61025.0
. I guess this answers my question. Thanks!