I had the same problem when upgrading from 4.6.1 to 4.7.2 of the framework. I had a great solution with many projects. This error was discovered when building the last project (win application), which had the correct <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> .
The cause of the problem was other projects used by the win app project. They had the wrong version of the framework.
source share