.net - vs 编译器提示 project.json 中缺少引用,但 .net proj 不是核心

标签 .net visual-studio asp.net-core

我有一个面向 .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/

相关文章:

c++ - visual studio 中的神秘警告 (4180)

visual-studio - 插入跟踪点 : how to set the default message?

c# - 无法解析类型为“Microsoft.AspNetCore.Identity.IRoleStore”的服务

.net - 如何使用 DataReceived 事件在 .Net 中使用 SerialPort?

.net - 如何判断定时器是否正在运行?

c# - 将屏幕捕获模拟为网络摄像头?

c# - 使用 C# 连接到 Visual Studio 2015 中的 Team Foundation Server?

asp.net - ASP .NET Core - Linux nginx ASPNETCORE_ENVIROMENT 错误

azure - 在可扩展的 Azure 应用服务中使用 Asp.Net Core 数据保护

c# - 将窗口保持在顶部并在 WinForms 中窃取焦点