Here's an interesting one. I have a small executable that is built against .NET 2.0, to ensure it operates on a wide variety of platforms. It is a one-assembly program and it references only System.* namespaces.
When I run it on an OS with .NET 2.0 installed, it runs fine. It will not run on an OS with only .NET 4.0 installed, because of the new runtime introduced with .NET 4.0. As a result, I added supported runtime information to the app.config file, as described here. I added two supported runtimes:
<supportedRuntime version="2.0.50727" />
<supportedRuntime version="4.0" />
Now when I run the application on a system with .NET 2.0 installed, it fails to run:
It makes no difference in which order the supported runtimes are defined, other than the order of the requested versions in the error message changes to reflect the changes to the app.config (so the CLR is obviously picking up that information properly). I have .NET 2.0 installed, and it is claiming that I need to install .NET 2.0! I have tried repairing the installation of .NET 2.0 with no luck. I have reproduced this behaviour on a second machine.
What could be causing this to fail?
I believe you may just have missed out the v
:
<supportedRuntime version="v2.0.50727" />
<supportedRuntime version="v4.0" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With