.net – The reference assemblies for framework “.NETFramework,Version=v4.6.2” were not found

netvisual-studio-2017

When trying to compile a solution, I get the following build error:

Error MSB3644 The reference assemblies for framework
".NETFramework,Version=v4.6.2" were not found. To resolve this,
install the SDK or Targeting Pack for this framework version or
retarget your application to a version of the framework for which you
have the SDK or Targeting Pack installed. Note that assemblies will be
resolved from the Global Assembly Cache (GAC) and will be used in
place of reference assemblies. Therefore your assembly may not be
correctly targeted for the framework you intend.
C:\RPR\Dev\Libraries\Common\Common.csproj C:\Program Files
(x86)\Microsoft Visual
Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 1111

I've tried installing the .NET Framework 4.6.2 SDK, as well as the 4.6 Targeting Pack, however both error that I already have it installed. I also tried installing Visual Studio 2017 but it still gives the same error.

Any ideas?

Best Answer

It turns out that I had installed the .NET Framework v4.6.2, not the Developer Pack for 4.6.2. Doh!

https://www.microsoft.com/en-us/download/details.aspx?id=53321