98

I'm trying to install the .NET Framework 4.7.1 in Visual Studio and I'm given the choice to install:

  • .NET Framework 4.7.1 SDK
  • .NET Framework 4.7.1 targeting pack

Do I need them both? What's the difference between each of them?

Alessandro Cifani
  • 1,419
  • 2
  • 12
  • 18
  • Refer this: https://stackoverflow.com/questions/35402827/what-is-the-difference-between-net-framework-4-6-1-targeting-pack-and-net-fram – Dil85 Jan 08 '18 at 09:51
  • 13
    I'd just like to note that I **don't** think this is a duplicate of https://stackoverflow.com/questions/35402827/what-is-the-difference-between-net-framework-4-6-1-targeting-pack-and-net-fram , as it talks about the Targeting pack and the runtime, not the targeting pack and the SDK. – Bradley Uffner Jan 09 '18 at 12:54
  • 1
    All the information https://github.com/dotnet/docs/blob/master/docs/framework/install/guide-for-developers.md – davidcarr Oct 19 '18 at 12:02
  • 2
    In addition, there are also "development tools" for each version! Even more confusion... – Alexander Dec 07 '18 at 12:14

3 Answers3

78

The .NET Framework SDK, is a software development kit (SDK) from Microsoft.

It is required to develop applications for the .NET Framework and it contains:

  • documentation
  • header files
  • libraries
  • Samples and tools.

.NET Framework SDK is dedicated to developing applications for .NET Framework. When installing visual studio, this is enough.

Targeting pack is needed when You are targeting a particular .NET framework which is different from your currently installed .NET framework.

In the case of the targeting pack, let's say you build your application using .NET 4.7 but the client has .NET 4.5. For this type of scenario you can target the client's version even though you are using a higher version.

Here you can see how to target a particular .NET framework.

CJBS
  • 15,147
  • 6
  • 86
  • 135
Tharushi Geethma
  • 1,249
  • 15
  • 21
  • 16
    It does not fully answer the question. Why should one ever install an SDK for .NET X when the target pack for .NET X is enough to build apps for it? – osexpert Jul 13 '18 at 08:28
  • 10
    @osexpert if I'm understanding correctly, you need the SDK to be able to develop. The targeting pack requires the SDK to function; it just allows you to use the SDK to target an earlier version, instead of just the SDK's version. – Tydaeus Jul 24 '18 at 23:02
  • 10
    FWIW I installed only the targetting pack without the SDK and I can build and run to that version (4.7.2 specifically) without problems. – Marc.2377 Mar 07 '19 at 02:04
  • @Marc.2377 Could it be that you had .NET Framework 4.7 installed manually prior to installing all the targeting packs? – Alex May 16 '20 at 18:48
  • @Alex No, I'm positive I didn't have it. – Marc.2377 May 18 '20 at 20:41
  • @Tharushi Geethma If I have version X SDK, does it mean I also have version X targeting pack? – Old Geezer Jun 05 '20 at 04:05
  • 2
    You'd want the SDK installed when developing in VS for a particular framework version in order to have the correct reference assemblies and IntelliSense. The targeting pack on its own, only provides support for the build targeting. – Ben Hall Aug 13 '20 at 11:40
  • This answer is copy-pasted from https://newbedev.com/what-s-the-difference-between-the-net-framework-sdk-and-the-targeting-pack – Neil Laslett Nov 21 '21 at 01:28
  • And none of this make any sense. Sorry for trolling an old thread, but @Ben Hall what is the difference between "developing...for a particular framework" and targeting a particular framework? If I have VS2022 with .NET 4.8 SDK but I need to work with an old .NET 4.6.1 project, why would I install the 4.6.1 SDK over the 4.6.1 targeting pack? Doesn't "developing for" mean the same as "targeting"? – Neil Laslett Nov 21 '21 at 01:32
  • @Neil Laslett..Yes, you only need the 4.6.1 targeting pack to compile/build your project which targets 4.6.1. I think most people just install latest SDK and keep adding targeting packs of different versions as they need. – Nagarjuna Borra Mar 19 '22 at 14:27
8

Here is the difference, according to

learn.microsoft.com

A targeting pack: lets your app target a specific version of the .NET Framework when developing in Visual Studio and some other development environments.

A developer pack: includes a specific version of the .NET Framework and its accompanying SDK along with its corresponding targeting pack.

In other words, for example: SDK 4.7.1 includes .NetFramework 4.7.1 and target pack 4.7.1. But if you want to target .Net Framework 4.6, you need to install the target pack 4.6

andreyk2 Hohlov
  • 619
  • 2
  • 9
  • 10
  • 2
    If the SDK includes the targeting pack, the SDK should be larger. But according to the Visual Studio installer, the 4.6.2 targeting pack is 135MB and the 4.6.2 SDK is only 28MB. Something is off here. – Jacob Stamm Jan 25 '22 at 15:13
  • @JacobStamm Lord bill works in mysterious ways – Allahjane Mar 01 '22 at 06:51
0

Wondered the same!. It looks like targeting packs are mainly to install reference assemblies(assemblies with no implementation) for that particular .net version, to just let IDE/Build tools compile.

I couldn't find much information on what exactly SDK comprises of, but I think its just bunch of tools plus some other stuff(the download size is consistently ~30mb across all .net versions)

some useful links -

Was the "Developer pack" originally called SDK?

Can I use Visual Studio 2015 to target .net framework 4.7?

https://learn.microsoft.com/en-us/dotnet/standard/assembly/reference-assemblies

On a side note: Developer pack = SDK + Targeting pack.