Use .NET 4.0 or .NET 3.5?

Windows 7 and Vista have the .NET 2.0 / 3.5 runtime installed, so anything you specify in 3.5 will work on Windows 7, and most of it on Vista. But Windows 8 only provides the .NET 4.0 CLR. When assembling an assembly using .NET 3.5 Windows 8, you will need to install the .NET 3.5 runtime. This would be inconsistent with .NET 3.5, but contra for .NET 4.0 would be a low market share in Windows 7 and below.

Which .NET platform should be used if high compatibility is required?

+4
source share
5 answers

According to this MSDN article, you will not need to install 3.5 on Windows 8, as it is backward compatible:

The .NET Framework 4 is backward compatible with applications that were created with the .NET Framework versions 1.1, 2.0, 3.0, and 3.5. In other words, applications and components created with previous versions of the .NET Framework will work with the .NET Framework 4.

Also, this question might be interesting: https://serverfault.com/questions/121563/are-net-versions-backwards-compatible .

+2
source

Well, it really depends on how you are going to deploy your application. I believe that using .net 4.0 might be a good idea, because installing a new version of the framework is very simple, especially using the built-in deployment tools in VS.

So, why look for an β€œolder” structure when you have the opportunity to use a better version? Will you get any benefits from using 4.0 instead of 3.5?

I believe, yes, but maybe not, in which case you can go for 3.5

+2
source

I think the question goes in the direction of which framework the OS will be supported β€œout of the box”. But, as you already noted, they do not have a common base between different operating systems. All you can do is create an installation project that validates the requirements.

But I think you should go with .Net 4 because it has the minimum size required for installation. For more information you can check smallestdotnet .

+2
source

.Net even supports side-by-side execution. Take a look at the MSDN article for more details.
Thus, running code> = 2.0 will not be a problem for future versions.
3.5 is a smart choice if you don't need a TPL.

+1
source

I thought that 4.NET includes all previous versions of the framework, starting with 1.0. But it seems that 3.5 should be explicitly "enabled" in Windows 8. In any case, 4.0 is the best option.

+1
source

Source: https://habr.com/ru/post/1400175/


All Articles