Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Targeting multiple versions of .net framework

Suppose I have some code that would, in theory, compile against any version of the .net framework. Think "Hello World", if you like.

If I actually compile the code, though, I'll get an executable that runs against one particular version.

Is there any way to arrange things so that the compiled exe will just run against whatever version it finds? I strongly suspect that the answer is no, but I'd be happy to be proven wrong...


Edit: Well, I'll go to the foot of our stairs. I had no idea that later frameworks would happily run exe's compiled under earlier versions. Thanks for all the responses!

like image 927
Matt Bishop Avatar asked Jan 24 '23 03:01

Matt Bishop


1 Answers

Im not sure if this is correct, but i'd try to compile it for the lowest version, the higher versions should be able to run the lower versions exe's.

like image 188
John Boker Avatar answered Feb 05 '23 01:02

John Boker