How can I disable live code analysis in Visual Studio 2017? - visual-studio-2017

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:
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?

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?

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" :
Make sure no rule set is checked in the "Add or Remove Ruleset" window.
Click "Save As" button:
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 :
In rule set details, uncheck all the sub rule sets and there is only "None" under "Action" column:
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.

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.
I have no idea if this stops/aborts/prevents more useful features, although it seems to "tame" VS 2019's background processing.

Related

Visual Studio 2017 (15.3.1) keeps hanging/freezing

I have recently installed Visual Studio 15.3.1 Community Edition (although I suspect this affects all editions). When doing actions such as
closing SQL .sql file tabs
copying or renaming files
other actions which I can't pinpoint
Visual Studio will freeze or hang for a few seconds or permanantly. It sometimes displays "(Not Responding)" in the title bar, but not always. This is getting really frustrating.
It seems like the Visual Studio feedback system is at fault. Turning it off solved my problem.
Open Visual Studio
Navigate to Help > Privacy > Privacy Settings
Select the "No, I would not like to participate" radio button and click OK
Hopefully whatever bug is causing this issue will be fixed soon and I'll happily participate in the feedback program again!
See this issue posted a lot on the MS forums.
I struggled with it for a while. When editing XAML files, it would always freeze and hang.
Tried many solutions that didn't fixed it. Then, I found the solution that did fix it for me.
I made two changes at the same time, so I can't say for sure which one solved it, but I can guess.
First change, which probably isn't the fix, is that I added the registry keys from this page. They were missing on my system. Page has a lot of detail, but having those keys set properly can't hurt. I noticed in Process Monitor that it was missing on the following regkey:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup\CachePath
Second change I made, the one I'm guessing solved the issue, was deleting the 17k+ ".TRN" files inside the following directory:
%LocalAppData%\Microsoft\VSApplicationInsights\
On my computer they were in something like the following:
C:\Users\Michael\AppData\Local\Microsoft\VSApplicationInsights\vstelXXX_SOMEGUID
Going back to check now, and after three-or-so hours of work there's another 475 files in that folder. It's producing about four or five .TRN files a minute, all with encrypted data inside. Not going to speculate as to the purpose of it, but I doubt it's anything good or useful. Deleted all those, and the XAML editor in VS now works fine, or at least as well as it ever did. No more 30+ second hangs on a modern twentysome core workstation.
In the recent update of VS 2022, the program suddenly starts freezing (randomly) and the fix for me was to turn off inline hints (the thing that pops up when you double click Ctrl key).
I'm using VS for C++ so I turned it off for C++ specifically
Go to the Tools menu tab -> Options

Disable lightweight solution load prompt

In VS2017 lightweight solution load is disabled by default and since I don't want it I am happy. BUT there is an annoying prompt which prompts me to enable it when I load a solution with a "Large" number of projects.
Is it possible to disable this prompt, so I do not enable it by accident ?
I have searched Tools -> options and the registry to no avail. Also what is a "large" number of projects I have not been able to find the number. Perhaps if one could raise the number to say 100000 then the prompt would never appear.
The Lightweight Solution prompt is shown three times, per solution, then a setting is stored locally which prevents it being shown again.
From: developercommunity.visualstudio.com: Viktor Veis: 27 Mar 2017:
The lightweight solution message is
shown 3 times per solution. These settings are stored in the suo file,
so deleting the file or the .vs folder next to solution will trigger
another 3 messages.
We're working on improving this experience in a future release.
Beetlejuice! Beetlejuice! Beetlejuice! Sigh
This message do not show again after setting the Lightweight solution load to disabled instead of default.
To do this, select your solution and in the property window (default F4) set the Lightweight load to Disabled
Screenshots here https://learn.microsoft.com/en-us/visualstudio/ide/optimize-visual-studio-startup-time#speed-up-solution-load

Finding C++ references in Eclipse

In eclipse C++ (with CDT), I would like to find all C++ references of the selected text. Ideally with the following constraints:
accessible via keyboard shortcut
a working set can be selected to restrict the search
I do NOT need to right click on my working set directory in Project Explorer > Index > Update with Modified Files, so that search results are relevant
Currently, I know:
Ctrl+Shift+G : but it searches in the whole project which is just huge. For those who know Visual Assist Plugin in Visual Studio, it is more or less the equivalent of shortcut Alt+Shift+F except Visual Assist indexer seems really faster to me, and I have never been bothered by the latency before.
Ctrl+H, then Enter : cool but if I can skip the Enter, and have a direct shortcut somehow, it would be just better
So, I have three questions:
Have you got this issue, in a big project with thousands of files, that the indexer gets in a wrong state (it is not in a running step who could explain that, it just seems wrong), so that if you modify a file, a next references search shows weird results, except if your right click on a directory in Project Explorer > Index > Update with Modified Files ? I tried to play around with Window > Preferences > C/C++ > Indexer but had not luck to improve that.
Is it possible to have a shortcut for Ctrl+H, then Enter ?
If not, is it possible to record/tune some kind of macro to avoid repeating these uncomfortable and distracting steps ?
Thanks,
Eclipse details:
Eclipse Version: Luna Service Release 2 (4.4.2)
CDT Version: 8.6.0.201502131403
Try to find "References in Project" instead of in the whole workspace. If you have several projects in your workspace, the search is slower than in only one project. First try References > In Project from the context menu to see if this command works well enough for you.
If you are satisfied with it, assign a hot key in menu Windows -> Preferences > General > Keys. Filter by text "References in Project", select the item with "Source" category. Change its hot key below and change "When" field to "C/C++ Editor".

How do I turn off auto-formatting in VS2013 for C++?

VS2013 has added auto-formatting for C++. My personal opinion on auto-formatting is that it's ultimately harmful for developers but I have to accept not everyone agrees. What bugs me is that I can't seem to disable auto-formatting completely. I have unchecked every checkbox under Tools->Text Editor->C/C++->Formatting->General yet when I type:
void f ()
VS2013 replaces this with
void f()
That's not the code-standard in this specific project which means I have to go back and insert a space. There are other examples where I have to fight against VS.
I don't want to change the spacing settings because
I work in multiple projects with different code standards
I don't believe in auto-formatting so I just want it to get out of my way
I just want VS to not modify my code automatically.
PS. I am not against that VS can format code but I want to invoke that manually
You can turn off automatic C / C++ /C# code formatting by going to the Options dialog from the Tools menu, selecting the Text Editor → C / C++ / C# → Formatting → General page, and unchecking all the boxes there. You'll still be able to manually format when all of the auto-formatting settings are turned off.
I know this isn't exactly the answer you're looking for, but you can preserver that void f () formatting if you go to Tools > Options > Text Editor > C/C++ > Formatting > Spacing and under Spacing for function parantheses you check the option Insert space between function names and opening parentheses of argument list.
I also had this problem and unchecking all the checkboxes in the formatting options did not help.
It turned out that this was caused by an option in the plugin “Visual Assist X” from Whole Tomato Software.
In my case this problem could be solved by going to “Visual Assist Options”-->”Corrections” and unchecking the Checkbox “Format after paste”.
It's a bug in VS 2013 beta that it cannot be turned off completely, see issue submitted by FuleSnabel: http://connect.microsoft.com/VisualStudio/feedback/details/797716/turning-off-auto-formatting-for-vs2013-c-only-seems-to-partial-disable-auto-formatting.
Some possible workarounds:
If you just peek into some projects which have different/weird style: if an unwanted auto-formatting happens, then you can perform one undo step, this should undo only the auto formatting part of the operation and not your contribution. Fortunately these two (or sometimes more auto formatting steps) are not grouped together into one command probably for this exact reason: you can go back and override it. It is annoying though if that happens all the time. You can configure the behavior to match your style, but you say you have project with different code styles.
Tools/Import and Export Settings... - you can export the specific settings for a certain project and then import it later. This will save .vssettings XML format file. If it's about just a specific file type, than it can be just a few kilobytes long. Unfortunately this requires manual steps. The best would be if these settings could be overridden from the solution configuration file or even the project configuration file, could be part of them.
Note, that this second point is problematic if you really work parallel in your projects with simultaneously open Visual Studios. In this case that settings will be saved finally what the last closed VS instance had I think.
Having different auto formatting saved for solutions can be a feature request for next release (certainly not make it to VS 2013). What I usually come across is the tab/space indentation behavior differences, it's the most common difference in project styles. Indentation also can be configured individually for most file types, but as as in your case, projects can differ, and then it becomes annoying.
Just remember that resharper can also override the indentation/formatting settings. You can turn that off by doing this
ReSharper -> Options -> Environment -> Editor -> Editor Behaviour -> Auto-format on closing brace (un-check this).
To turn off automatic brace completion, go to:
Tools > Options > Text Editor > All Languages > General > Automatic brace completion
...then uncheck "Automatic brace completion".
Go to:
Tools->Options->Text Editor->C/C++->Formatting->Spacing
Then deselect or select the boxes that pertain to the code type you are writing.

How do you enable auto-complete functionality in Visual Studio C++ express edition?

Please guide me, how do you enable autocomplete functionality in VS C++? By auto-complete, I mean, when I put a dot after control name, the editor should display a dropdown menu to select from.
Thank you.
Start writing, then just press CTRL+SPACE and there you go ...
When you press ctrl + space, look in the Status bar below.. It will display a message saying IntelliSense is unavailable for C++ / CLI, if it doesn't support it.. The message will look like this -
It's enabled by default. Probably you just tried on an expression that failed to autocomplete.
In case you deactivated it somehow... you can enable it in the Visual Studio settings. Just browse to the Editor settings, then to the subgroup C/C++ and activate it again... should read something like "List members automatically" or "Auto list members" (sorry, I have the german Visual Studio).
Upon typing something like std::cout. a dropwdownlist with possible completitions should pop up.
All the answers were missing Ctrl-J (which enables and disables autocomplete).
Goto => Tools >> Options >> Text Editor >> C/C++ >> Advanced >>
IntelliSense
Change => Member List Commit Aggressive to True
VS is kinda funny about C++ and IntelliSense. There are times it won't notice that it's supposed to be popping up something. This is due in no small part to the complexity of the language, and all the compiling (or at least parsing) that'd need to go on in order to make it better.
If it doesn't work for you at all, and it used to, and you've checked the VS options, maybe this can help.
Have you tried Visual Assist X ? Sort of lights up the VS editor.
I came across over the following post:
http://blogs.msdn.com/b/raulperez/archive/2010/03/19/c-intellisense-options.aspx
The issue is that the "IntelliSense" option in c++ is disabled.
This link explains about the IntelliSense database configuration and options.
After enabling the database you must close and reopen visual studio
for autocomplete use 'ctrl'+'space'
'ctrl'+'space' will open C/C++ autocomplete.
Include the class that you are using Within your text file, then intelliSense will know where to look when you type within your text file. This works for me.
So it’s important to check the Unreal API to see where the included class is so that you have the path to type on the include line. Hope that makes sense.
It's enabled by default. Probably you just tried on an expression that failed to autocomplete.
In case you deactivated it somehow... you can enable it in the Visual Studio settings.
Step 1: Go to settings
Step 2: Search for complete and enable all the auto complete functions
I believe that show help