Your project is not referencing the “.NETFramework,Version=v4.5” framework.

后端 未结 6 1595
独厮守ぢ
独厮守ぢ 2020-12-24 11:20

I am using VS 2015.

Your project is not referencing the \".NETFramework,Version=4.5\" framework. Add a reference to \".NETFramework,Version=4.5\" in

6条回答
  •  粉色の甜心
    2020-12-24 11:59

    I had the same problem - this occurs still using Visual Studio 2017.3, which uses .csproj files instead of project.json. Interestingly, the error message still contains the text "project.json".

    It appears the cause of this issue is a lock file or obj\project.assets.json file (depending on your version of VS) from a previous build, which is not removed during a clean, as described here.

    Manually deleting the /obj directory is a quick workaround.

    If you have a "new" project (eg .NET Core or netstandard project created in VS 2017) and an "old" project in the same directory (eg .NET 4.6 project created in VS 2015), it appears they will continually fight because they both use the ./obj dir in different ways. More info here..

    The msbuild workaround is to make one of your projects use a different obj dir. I added this to my "old" csproj:

    
      
      obj_netfx\
    
    

提交回复
热议问题