Let us understand how to target .NET Framework 2.0 (not .NET Core 2.0) in Visual Studio 2017 while working on a legacy project like Open Hardware Monitor, without installing older versions of Visual Studio.

Challenges

  • Visual Studio 2017 does not come with .NET Framework 2.0 targeting pack.
  • The minimum installable targeting pack via the installer is 3.5 SP1.
  • .NET Framework 2.0 is extremely outdated, and modern tools no longer support it by default.
  • Projects that use .NET 2.0 may include APIs that are deprecated, making it harder to upgrade.
  • Open Hardware Monitoruses .NET 2.0, meaning it cannot be retargeted easily without breaking functionality.

Solution

Step 1: Manually Install .NET Framework 2.0 Targeting Pack

Microsoft does not offer it directly via the Visual Studio Installer, but it can be installed manually.

Step 2: Set the Target Framework in the Project

Once the targeting pack is installed:

  • Open the project in Visual Studio 2017.
  • Right-click on the project > Properties > Application tab.
  • Under Target Framework, choose .NET Framework 2.0.

If 2.0 still does not appear:
-> Edit the .csproj file manually:

<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>

Step 3: Verify the Build Tools Compatibility

Make sure:

  • The build tools and MSBuild installed with VS2017 can compile .NET 2.0 apps (they can, as long as the targeting pack is present).
  • No NuGet packages requiring higher frameworks are being used.

Step 4: Confirm Build Compatibility

  • Ensure no incompatible packages or C# language features are used.
  • Stick to C# 2.0 syntax and libraries if possible.

Need Help With .Net Development?

Work with our skilled .Net developers to accelerate your project and boost its performance.

Hire .Net Developers

Support On Demand!

Related Q&A