如何在 Visual Studio 2017 年禁用 Roslyn 语言服务?

How to Disable Roslyn Language Services in Visual Studio 2017?

我刚刚安装了 Visual Studio 2017 v15.8 的新版本。我的应用程序中有 8 个项目。当我尝试打开解决方案时,需要 1 分钟(在旧版本中,需要 5-10 秒)。根据我的研究,我尝试通过 3 种不同的技术来解决这个问题,但其中 none 解决了我的问题。

  1. 在"Manage Visual Studio Performance"中,我尝试禁用Roslyn语言服务,但是禁用按钮被禁用了。我的意思是禁用按钮是灰色的。所以没用。
  2. 在工具 -> 选项 -> 文本编辑器 -> C# -> 高级中,有一个名为“启用完整解决方案分析”的复选框。试图取消选中它,但它已经取消选中。所以我尝试选中并再次取消选中但没用。
  3. 在工具 -> 选项 -> 文本编辑器 -> 所有语言 -> CodeLens 中,有一个名为 "Enable CodeLens" 的复选框。我取消选中它,但我的问题仍然存在。

那么如何在 Visual Studio 2017 年禁用 Roslyn 语言服务?还是有另一种我不必禁用它的方法?

来自the Visual Studio Developer Community

The Roslyn Language Service is an essential service to VB & C# and cannot be disabled. The message is simply warning you that the service is taking longer than usual, so if you are experiencing performance problems, you can upload traces for us to investigate at that point via the feedback mechanism.

看来禁用 RLS 实际上会使您的 IDE 像记事本一样。 Microsoft 不允许您禁用它。您可以尝试重现并修复问题。

您是否尝试过 https://developercommunity.visualstudio.com/content/problem/320800/vs-1581-project-load-and-file-access-very-slow.html 中的解决方案?

我不认为这是因为 Roslyn 语言服务。此外,根据 link,您可以将 Visual Studio 2017 版本升级到 15.8.7 或更高版本。它可能会解决你的问题。