How to Configure Visual Studio to use NETFX 4.7 Tools when NETFX 4.6.1 Tools are also installed

Viewed 2362

Merge during WebApp publishing from Visual Studio 2017 15.2 is still using asp_net.merge.exe in version 4.6.1 (as per publishing output log), not corresponding to .Net Framework version 4.7 installed. Framework 4.7 version is set as a target framework for the project.

Both merge tools are installed:

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\aspnet_merge.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7 Tools\aspnet_merge.exe

How to configure Visual Studio to start using 4.7 version of aspnet_merge.exe?

2 Answers

I have the same error, Im using Visual Studio 2017 (15.9.5), and need compile for .net 4.7.2; after many testing, this works for my:

  1. Install the latest Windows 10 SDK
  2. Install the .net 4.7.2 Developer Pack
  3. Configure the installer of Visual Studio to target the .net 4.7.2 SDK
  4. Specify the path to the SDK editing directly in the [projectname].csproj file, add:

<TargetFrameworkSDKToolsDirectory>C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools</TargetFrameworkSDKToolsDirectory>

May you can't to do it, the CLR is one per dist, see about:Forum Asp.NET

Related