.net framework versions

hello everyone
does any .net framework version have previous versions in it?
for example now i have the latest version (4.7)
do i need the previous versions (1.0 - 4.6) ?

No, .Net Framework versions don’t really contain previous versions inside them. How it works is that a newer versions often replaces the previous version, while maintaining compatibility. So, if you have a .Net Framework 4.0 application, you can still run it if you have .Net Framework 4.8 installed.

Though very old versions of .Net Framework exist side-by-side with 4.x versions: if you have e.g. a .Net Framework 3.5 application, you will need to install .Net Framework 3.5 separately from any 4.x version.

so why new versions don’t replace older versions (before v.4) as well?

I think the old versions of .NET Framework such as 2.0 and 3.5 use an older CoreLib and runtime.
The older versions have some differences in the CoreLib frameworks I believe.

If you have .NET 4.8 installed, you can run 4.0 though 4.8 targeted apps as the CoreLib and runtime is compatible.

And does .net framework 3.5 contain previous versions ?
So that we just use .net framework 3.5 and the latest version of 4.x

The .NET full Framework 3.5 installer comes with .NET Framework 2.0, 3.0 and 3.5. So technically yes.

But what are you trying to accomplish?
If you target .NET Framework 4.0, you can run your app on Windows XP,Vista,7,8,10.
If you target .NET Framework 4.6, you can run your app on Windows Vista,7,8,10.

You should not target 3.5 unless you need to target Win 2000.

Excuse me my question may be silly but i’m confused
For example ADO.NET was released in .net framework 2.0
You say 4.x versions doesn’t contain the features of previous versions
And after that you say I must target .net framework 4.x and not previous versions
So how can I use ADO.NET in my program? (ADO as an example)

4.x does contain “framework” features from 2.0, 3.0 and 3.5 versions BUT sometimes those features may differ or be extended in 4.x frameworks.

What versions of Windows do you care about targeting?
If you are starting a new .NET project use “.NET Core 3.1”.

But If you require ADO.NET use .NET Framework 4.8: https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/runtime/4.0-4.8

1 Like
.NET Foundation Website | Blog | Projects | Code of Conduct