locked
What should be the target .NET Framework for my Add-in that supports for VS 2010, 2012 and 2013? RRS feed

  • Question

  • I have an add-in developed using VS 2013 that supports VS 2010, 2012 and 2013. My current project targets .NET Framework 4.0. If I change the target .NET Framework 4.5 will the users of add-in experience any issues?

    Joginder Nahil

    Wednesday, June 24, 2015 7:33 AM

Answers

  • Yes, because VS 2010 doesn't ship .NET Framework 4.5, only .NET Framework 4.0.

    * My new blog about VSX: http://www.visualstudioextensibility.com * Twitter: https://twitter.com/VSExtensibility * MZ-Tools productivity extension for Visual Studio: http://www.mztools.com.

    • Proposed as answer by Carlos J. Quintero Wednesday, June 24, 2015 8:31 AM
    • Marked as answer by J S Nahil Wednesday, June 24, 2015 9:37 AM
    Wednesday, June 24, 2015 8:29 AM
  • Hi,

    Even if Microsoft.VisualStudio.Shell.12.0 was built with .NET 4.0, you shouldn't use it to target VS 2010 / VS 2012 because that dll would be missing on a computer with only VS 2010 or VS 2012 and you cannot legally redistribute it with your setup, so your extension would fail.

    Bottom line: if you want to target VS 2010 or higher, you need to use version 10.0 of reference assemblies, not version 11.0 / 12.0


    * My new blog about VSX: http://www.visualstudioextensibility.com * Twitter: https://twitter.com/VSExtensibility * MZ-Tools productivity extension for Visual Studio: http://www.mztools.com.

    • Marked as answer by J S Nahil Wednesday, June 24, 2015 11:14 AM
    Wednesday, June 24, 2015 11:01 AM

All replies

  • Yes, because VS 2010 doesn't ship .NET Framework 4.5, only .NET Framework 4.0.

    * My new blog about VSX: http://www.visualstudioextensibility.com * Twitter: https://twitter.com/VSExtensibility * MZ-Tools productivity extension for Visual Studio: http://www.mztools.com.

    • Proposed as answer by Carlos J. Quintero Wednesday, June 24, 2015 8:31 AM
    • Marked as answer by J S Nahil Wednesday, June 24, 2015 9:37 AM
    Wednesday, June 24, 2015 8:29 AM
  • Thanks Carlos,

    I want to integrate your solution to Enumerating Visual Solution Hierarchy  that needs Microsoft.VisualStudio.Shell.12.0. I add this reference from

    C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK\VisualStudioIntegration\Common\Assemblies\v4.0\Microsoft.VisualStudio.Shell.12.0.dll 

    And target my DLL to .NET Framework 4.0 I get the following warning:

    Warning 1 The primary reference "Microsoft.VisualStudio.Shell.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0". StarPrint.SolutionEnumeratorWhat is the solution?

    Joginder

    Wednesday, June 24, 2015 9:43 AM
  • Hi,

    Even if Microsoft.VisualStudio.Shell.12.0 was built with .NET 4.0, you shouldn't use it to target VS 2010 / VS 2012 because that dll would be missing on a computer with only VS 2010 or VS 2012 and you cannot legally redistribute it with your setup, so your extension would fail.

    Bottom line: if you want to target VS 2010 or higher, you need to use version 10.0 of reference assemblies, not version 11.0 / 12.0


    * My new blog about VSX: http://www.visualstudioextensibility.com * Twitter: https://twitter.com/VSExtensibility * MZ-Tools productivity extension for Visual Studio: http://www.mztools.com.

    • Marked as answer by J S Nahil Wednesday, June 24, 2015 11:14 AM
    Wednesday, June 24, 2015 11:01 AM