Can MS .NET 4.6 be used with Visual Studio 2010
Asked Answered
S

4

9

We are still using VS 2010 SP1 to develop a large scale LOB ASP.NET web application. The infrastructure folks are looking at pushing .NET 4.6 (and the targeting pack to devs) to the desktop and I am having trouble finding anything on compatibility with VS 2010. One of the leads here said the two are incompatible and cannot be used together and that you must have VS 2012 or higher but I can't find anything official on the topic. Anyone know if it is possible to use .NET 4.6 and VS 2010 SP1 for development?

Stadiometer answered 27/10, 2015 at 21:34 Comment(2)
Why are you trying to stay on 2010 and not moving to a later version?Popgun
Its a matter of timing, the plan is to move off of VS 2010 but not before the enterprise plans on pushing .NET 4.6.Stadiometer
P
17

Visual Studio 2010 does not support the 4.6 targeting pack. When the targeting pack is pushed to the machine, Visual Studio 2010 will not see it.

Now, this isn't actually a problem if you want to remain on a supported version of .NET (which is probably why your infrastructure folks are doing what they are doing), because even if you target 4.0, you can remain supported by deploying 4.6 and running your 4.0 application on it. We shim 4.0 behavior in this case, so when you're testing on a machine with just 4.0, you can be guaranteed that the application will run with high confidence on 4.6.

However, what I see devs run into a lot, is when they target 4.0, but test on a machine with 4.6 installed, then expect to be able to deploy to 4.0 and have this just run. In this case, there's not a 100% guarantee that this will work as we do not shim every single bug fix and/or feature. This means you can accidentally pick up 4.6 behavior, and rely on it.

To summarize:

  • If you target 4.0, test on 4.0 and deploy to 4.0/4.6 -> We guarantee that this works with pretty high confidence.

  • If you target 4.0, test on 4.6 and deploy to 4.6 -> We guarantee that this works with pretty high confidence.

  • If you target 4.0, test on 4.6 and deploy to 4.0 -> This will work in most cases, but you could accidentally depend on "fixed behaviors" that aren't fixed on 4.0.

Punak answered 28/10, 2015 at 20:29 Comment(2)
Note: David works for Microsoft and this is about as authoritative of an answer as you can get.Caprification
Thanks David - I appreciate your responseStadiometer
C
2

Visual Studio does support multi-targeting. For example, if I were using Visual Studio 2012 I could install the 4.6 multi-targeting pack to develop a 4.6 application.

However, the download instructions for the 4.6 multi-targeting pack do not mention support for Visual Studio 2010, just 2012 and 2013:

The .NET Framework 4.6 Targeting Pack is a package that enables developers to build applications targeting the .NET Framework 4.6 by using either Visual Studio 2013, Visual Studio 2012 or third-party IDEs

That's as close to any documentation as I've found. This leads me to believe that no, support for 4.6 multi-targeting does not exist for Visual Studio 2010.

Caprification answered 27/10, 2015 at 22:17 Comment(2)
My fear is your are correct - it would be great to get a definitive answer from Microsoft, especially since support for 4.5.1 ends in JanuaryStadiometer
@Stadiometer I reached out to some Microsoft folks to see if I can get them to write a canonical answer.Caprification
A
1

Wiki contains a cross reference of visual studios and .net versions they support. MS Visual Studio History

Each new version of .NET comes with more than just a new compiler. New Tools, Projects, and even IDE functionalities are added too. If you must use the features of 4.6, you should look into upgrading your VS too.

Asper answered 27/10, 2015 at 22:9 Comment(2)
Thanks for your reply -Stadiometer
My question concerns backward compatibility, not a desire to implement new features added in .NET 4.6, unfortunately the wiki just reiterates the marketing material at the time of release. We are currently using .NET 4.5.2 and targeting .NET 4 successfully with VS2010 but had some hiccups when 4.6 replaced .NET 4.5.2 and I can not determine the cause at this time which is why I posted this question hoping someone from the Visual Studio Team might pick it up - thanks again.Stadiometer
R
0

You can't change to 4.7 framework on Vs2010 but you can change it ( or create it ) on another version of Visual Studio like 2019, then you can open it, coding, debug, build...on vs2010. This is not apply to all but it's work in almost my project

Riccio answered 2/3, 2023 at 1:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.