9
votes

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?

3
Why are you trying to stay on 2010 and not moving to a later version?Scott Chamberlain
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.user5495678

3 Answers

17
votes

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.

2
votes

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.

1
votes

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.