Your project is not referencing the ".NETFramework,Version=4.5" framework

          在VS2017之前工程文件切换版本一般情况是没有什么错误的,但是今天在VS2017上进行了一次切换直接报错了:

       Your project does not reference ".NETFramework,Version=v4.5" framework. Add a reference to ".NETFramework,Version=v4.5" in the "TargetFrameworks" property of your project file and then re-run NuGet restore. 

        仔细确认了下,也仅是更改了这块设置,其它地方没动啊

           后来度娘了下,直接删除工程文件下的obj文件就可以了。以下是原文:

          

   

原文地址:https://www.cnblogs.com/zhongjicainiao/p/11777448.html