Roslyn 编译器服务器报告与构建任务不同的哈希版本

Roslyn compiler server reports different hash version than build task

我在 Visual Studio 2019 年构建了一个 ASP.NET Core 3.1 应用程序。

该应用程序之前正在编译,我能够在同一台计算机上对其进行调试。然而,在没有对应用程序进行任何更改的情况下,我突然开始收到错误消息 "Roslyn compiler server reports different hash version than build task"

下载 repo 并在另一台计算机上调试工作正常,但这不是现有计算机的解决方案。

发生的事情是 "partally updated" 由 visual studio 安装程序编译。这是 Visual Studio 中的设置问题。如果你可以 运行 https://aka.ms/vscollect.exe and upload the zip file in the temp directory to a new issue on Developer Community 设置团队应该能够查明真相。

为了解决您的问题,您需要 运行 "repair" VS 安装程序。