Targeting Pack: Microsoft .net Framework 4 Multi
1. Introduction & Core Purpose The Microsoft .NET Framework 4 Multi-Targeting Pack is a software component for developers using Microsoft Visual Studio (primarily versions 2010, 2012, 2013, and to some extent 2015). Its primary purpose is to allow a developer to build an application that targets a specific version of the .NET Framework (e.g., .NET 4.0, 4.5, 4.5.1, 4.6) without requiring that version to be installed as the running framework on the development machine. Key Problem It Solves Before multi-targeting packs, developing an app for .NET Framework 3.5 while having .NET 4.5 installed often led to accidental usage of APIs from the newer framework, resulting in MissingMethodException or TypeLoadException at runtime on machines lacking the newer framework. The multi-targeting pack enforces a reference assembly boundary at compile time. Core Principle: Reference Assemblies vs. Implementation Assemblies The pack contains reference assemblies – metadata-only versions of framework DLLs (e.g., mscorlib.dll , System.dll ) that contain no executable code but declare all types, methods, and attributes exactly as they existed in that specific framework version. These ensure the compiler binds to the intended API surface. 2. Historical Context & Evolution | .NET Framework Version | Visual Studio Version | Multi-Targeting Pack Availability | |------------------------|----------------------|------------------------------------| | 4.0 | VS 2010 | Built-in (first native multi-targeting support) | | 4.5 | VS 2012 | Separate download (KB 2748645) | | 4.5.1 | VS 2013 | Included in Update 2+ | | 4.6 - 4.8 | VS 2015/2017/2019/2022 | Integrated into .NET SDK |
HKLM\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.0\WinSDK-NetFx40Tools-x86 InstallationFolder = C:\Program Files (x86)\Reference Assemblies\... microsoft .net framework 4 multi targeting pack
The .NET Framework 4 Multi-Targeting Pack was especially critical for the transition from .NET 4.0 to 4.5 because 4.5 was an (overwrote 4.0's CLR and system assemblies). Without the pack, developing for 4.0 on a machine with 4.5 installed was nearly impossible. 3. Technical Architecture & Components 3.1 Installation Artifacts When installed, the pack places reference assemblies into well-known directories: microsoft .net framework 4 multi targeting pack