Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

app.config <supportedRuntime>

Suppose I have a WinForms app that is built and compiled against .NET 2.0 using VS2008.

It is my understanding that at runtime, the app will attempt to load the .NET 2.0 CLR first, (because that is what it was compiled against), regardless of anything that may be listed in any "supportedRuntime" element of the app.config file.

If it can't find it, then it will then go through a process of deciding on another version by checking the app.config, etc.

For example, if .NET 2/3/3.5 and .NET 4.0 are installed on a machine, and I have:

<supportedRuntime>V4.0</supportedRuntime>

in the app.config, the app will still choose to load and run .NET 2.0.

Is that correct?

Thanks.

like image 857
Andy Avatar asked Jan 29 '26 08:01

Andy


1 Answers

The MSDN page seems to be clear that the one used to build is only the fallback case:

http://msdn.microsoft.com/en-us/library/w4atty68.aspx

If the <supportedRuntime> element is not present in the application configuration file, the version of the runtime used to build the application is used.

Are you seeing behavior that doesn't match that of this MSDN page?

like image 51
James Manning Avatar answered Jan 30 '26 23:01

James Manning



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!