如何禁用所有 Roslyn 代码分析器? [英] How do I disable all Roslyn Code Analyzers?

查看:24
本文介绍了如何禁用所有 Roslyn 代码分析器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试与一个包含少量 Roslyn 代码分析器的大型开源项目合作.当我打开解决方案时,Visual Studio 使用 ~35% CPU 大约 15 分钟.使用 PerfView,我发现在解决方案上运行的代码分析器使 Visual Studio 陷入困境.

I'm trying to work with a large opensource project that has a handful of Roslyn Code Analyzers. When I open the solution Visual Studio uses ~35% CPU for about 15 minutes. Using PerfView I've figured out that the code analyzers being run on the solution are bogging down Visual Studio.

我知道可以在每个项目的基础上禁用分析器,但此解决方案包含 100 多个项目,因此我不想一个一个地执行此操作.

I know it's possible to disable analyzers on a per-project basis but this solution contains over 100 projects so I'd rather not do this one-by-one.

我的问题:

  • 我可以禁用给定解决方案的所有 Roslyn 分析器以避免这种情况吗?
  • 我可以为 Visual Studio 中的所有解决方案禁用所有 Roslyn 分析器吗?

推荐答案

尝试 Tools/Options/Text Editor/C#/Advanced 并禁用完整的解决方案分析.仅在 VS2015 Update 2 后可用.

Try Tools/Options/Text Editor/C#/Advanced and disable full solution analysis. It's only available since VS2015 Update 2.

这篇关于如何禁用所有 Roslyn 代码分析器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆