Your project does not reference ".NETFramework,Version=xxx" framework. Add a reference to ".NETFramework,..." property of your project file and then re-run NuGet restore.
错误:Your project does not reference ".NETFramework,Version=v4.6.1" framework. Add a reference to ".NETFramework,Version=v4.6.1" in the "TargetFrameworks" property of your project file and then re-run NuGet restore.
解决方案:
删除工程目录下的 obj 文件夹。 再进行编译