25

Where can I disable live code analysis in Visual Studio 2017? This pops up every time I start my solution. I do not need this:

Live code analysis pop-up picture

I've followed this support document from Microsoft but unchecking "Enable full solution analysis" seems to have no effect on live code analysis. Then I found a solution for Visual Studio 2012 but also without any luck.

So it seems to me that live code analysis is a complete different thing not managed by full solution analysis. It is running immediately as a background process task after (re)starting the solution. Anyway, how can I get rid of this?

colidyre
  • 4,170
  • 12
  • 37
  • 53

3 Answers3

10

It's not possible In VS2017

only if all Roslyn installed components in Extensions and Updates are disabled.

I'm using a workaround, global setting forces analyses runs at build on solution projects, in editor runs at any change but now editor is a lot faster with bellow workaround:

Tools -> Options -> Text Editor -> C# (in my case) -> Advanced -> Perform editor feature analysis in external process (experimental) -> select it and save.

UPDATE: It's possible in VS2019 16.5

More details on closed issue (solution is for VS2019):How to disable live code compilation/analysis in Visual Studio 2017?

Community
  • 1
  • 1
SilentTremor
  • 4,747
  • 2
  • 21
  • 34
10

I had a similar problem. There is this huge temp initialization file in the project, 50K+ lines. Whenever I opened it, Live code analysis would kick in and VS would eat up CPU up to 50%. I was able to turn it off by creating an empty rule set and set it on Code Analysis section of the project's properties. Now It looks like it's running, only for a few seconds and then it stops since there is no rule to apply.

I don't know if this exactly applies to your problem but here how it goes.

To create an empty rule set;

  • Click "Choose multiple rule sets" from the ComboBox under "Run this ruleset" : Choose multiple rule sets

  • Make sure no rule set is checked in the "Add or Remove Ruleset" window.

  • Click "Save As" button: List of Rule Sets
  • In file dialog, save your new rule set. I named mine as "EmptyRuleSet".
  • After saving process, new empty rule set should be selected in the ComboBox. Click the "Open" button below : Open button
  • In rule set details, uncheck all the sub rule sets and there is only "None" under "Action" column: Empty Rule Set Detail
  • Save the changes on project properties. After these steps, you can see that "Live Code Analysis" run empty for a few seconds when you open a file or start the solution, then it stops. You may have to restart the VisualStudio.

Live Code Analysis - empty run

AntiqTech
  • 717
  • 1
  • 6
  • 10
  • 1
    Yes, if live code analysis pops up but goes away after seconds, it seems to be a good workaround. The project has ended and I haven't access to the VM any more. So unfortunately, I cannot check your workaround. But it sounds promising. – colidyre May 24 '19 at 09:21
  • No problem, I've had this problem for the past few weeks and I was only able to solve it yesterday. – AntiqTech May 24 '19 at 09:23
  • 1
    I'm still trying this out, but at first sight VS went from constant 25% to now 0% during idle. I was living with a supersluggish Visual Studio the last two years - this is SUPER broken. Thanks for your workaround. – Dirk Boer Aug 11 '19 at 20:25
2

I was able to make VS 2019 run at acceptable speeds using the 'Auto cancel long running auxiliary operations on typing' setting. The default 'Automatic' setting appeared ineffective, although changing it back now doesn't seen to re-introduce the very slow background processing issue.

enter image description here

I have no idea if this stops/aborts/prevents more useful features, although it seems to "tame" VS 2019's background processing.

user2864740
  • 60,010
  • 15
  • 145
  • 220
  • 1
    The question related to VS 2017, but the answer is interesting, since it seems impossible to stop the "live code analysis" with VS 2017. I don't have a way to check this answer here at the moment. But it's nice to hear that there are more possibilities with VS 2019. – colidyre Sep 06 '19 at 06:44
  • @colidyre For the latest VS 2019 with some .NET Core SDK packs, it's what I see :| – user2864740 Sep 06 '19 at 16:07