我有一个面向 .NET f/w 4.5.2 的 MVC 应用程序。我正在从前一个分支上的 .NET 核心应用程序复制一些文件。我在之前的分支上安装了几个 npm 包。现在,在我刚刚从 develop 创建的新干净分支上,VS 返回以下错误:
Severity Code Description Project File Line Suppression State Error Your project is not referencing the ".NETFramework,Version=v4.5.2" framework. Add a reference to ".NETFramework,Version=v4.5.2" in the "frameworks" section of your project.json, and then re-run NuGet restore. MyCompany.Website
我认为 project.json 是特定于 .NET Core f/w 的文件,因此编译器不应要求在 4.5.2 应用程序中更新 project.json。我需要做什么才能绕过此错误消息?我在这个目录上尝试了“git clean -f”,但错误仍然存在。知道如何解决这个问题吗?
最佳答案
这是 Visual Studio 中的一个错误。
参见 https://github.com/dotnet/roslyn/issues/20628
一种解决方案是查找过时的 project.lock.json
和/或 project.assets.json
文件并将其删除。
关于.net - vs 编译器提示 project.json 中缺少引用,但 .net proj 不是核心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42033804/