0
votes

I have installed Visual Studio 2012 Express, and .NET Framework 4.5 got installed together.

Now from Visual Studio 2012, also if I target .NET 4.0 (Properties->Application->Target Framework), that doesn't seem to work. (The same happens from Visual Studio 2010, which by the way cannot target 4.5 at all!).

What I have noticed is that if I debug my project, and set a Watch on a SqlConnection variable, I see all the new 4.5 member properties (for example I see SqlConnection.ClientConnectionId property, introduced with .NET 4.5).

So, what is Visual Studio -> Properties -> Application -> Target Framework -> 4.0 supposed to do?

1
With a hack, Visual Studio 2010 can actually target .NET 4.5: Targeting .NET Framework 4.5 via Visual Studio 2010Peter Mortensen

1 Answers

1
votes

This 'strange' behaviour looks, in fact, perfectly normal when you realize that the installation of .NET Framework 4.5 is a replacement of .NET 4.0.

Look at Stack Overflow answer Can a build server with .NET 4.5 installed successfully deploy a project targeting 4.0 to a server with only .NET 4.0 installed?.