Can Hello World exe work in all versions of .NET? (2.0 and 4.5)

Is it possible that .NET exe works on all versions of .NET from 2.0 to 4.5 without separate binaries?

Suppose all I need to do is Console.Writeline("Hello world");

+4
source share
3 answers

Yes, just make sure you target the .Net 2.0 framework.

You can see: Version Compatibility in the .NET Framework

The .NET Framework 4.5 supports backward compatibility with applications that were built with the .NET Framework versions 1.1, 2.0, 3.0, 3.5, and 4. In other words, applications and components built using previous versions of the .NET Framework will work with the .NET Framework 4.5. .

+8
source

You can target .NET 2.0, which will also work on .NET 4.0 due to backward compatibility.

+2
source

Crate Applies any IDE with .Net Framework 2.0. So you can work in any Framework above 2.0..Net Framework supports backward compatibility.

0
source

All Articles