5

I'm trying to implement the solution described here: Can I use a .NET 4 feature while targeting .NET 3.5 SP1?. It works fine when a .NET 3.5 application runs on .NET 4.0. However, on .NET 4.5 the app runs on .NET 3.5 environment. I have tried the following:

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0"/>
<supportedRuntime version="v2.0.50727"/>

with no success. Environment.Version still tells 2.0.50727.5456 while on .NET 4.0 everything is OK.

Is there a way to force .NET 3.5 app use .NET 4.5 if available?

Community
  • 1
  • 1
eigenein
  • 2,083
  • 3
  • 25
  • 43

1 Answers1

7

It's my fault: app.config accidentally was not copied onto build directory. Everything works with:

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0"/>
<supportedRuntime version="v2.0.50727"/>
eigenein
  • 2,083
  • 3
  • 25
  • 43