Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to make one Hello World exe work in all versions of .NET? (2.0 and 4.5)

Is it possible to have a single .NET exe operate on all versions of .NET from 2.0 through 4.5 without having separate binaries?

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

like image 288
makerofthings7 Avatar asked Dec 27 '22 13:12

makerofthings7


1 Answers

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

You may see: Version Compatibility in the .NET Framework

The .NET Framework 4.5 is backward-compatible 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 with previous versions of the .NET Framework will work on the .NET Framework 4.5.

like image 160
Habib Avatar answered Dec 29 '22 04:12

Habib