Build error while transitioning between branches: Your project is not referencing the “.NETFramework,Version=v4.7.2” framework

前端 未结 8 1178
暗喜
暗喜 2021-02-01 12:40

We\'re using Git and we have a solution which is targeting the full net framework. A couple of days ago, I\'ve started migrating the solution to .net core. Unfortunately, someth

8条回答
  •  隐瞒了意图╮
    2021-02-01 13:23

    Sounds like you might have some libraries that aren't Core compatible. If Nuget is expecting/requiring 4.7.2, then something is likely still targeting it, either in your project or a library I'd venture. Would also explain why cleaning up the Nuget packages and restoring them doesn't fix the issue if the package that you're restoring still targets 4.7.2.

    Related note, are you sure that you're using the latest project structure? I noticed that your error message includes project.json, which was deprecated in favor of the new csproj format; more info is here if it's relevant. I'm not aware of a situation where you'd get an error message about project.json and the solution didn't have a project.json.

提交回复
热议问题