(VS2017) Randomly losing reference and intelliscense - visual-studio-2017

I am currently facing a weird problem with visual studio 2017 community edition.
It randomly lose all reference in the "reference tab" and the intellisense stop work at all.
It is only at design time, even with tons of "false errors" in the error window, if you compile and run, it will work just fine.
I was looking over some similar problems and one solution said to remove one tag from the .projec file.
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
I did it, at first time it worked, but after while, it randomly stopped working again. I went back to the file but that particular tag wasn't there.
The weird part is that when it happens, if I go to the reference window, it have all namespaces unselected. if I select any namespace, it throws me an error and select all corretc namespaces at same time.
After selecting the namespace, when I save the project I get this error.
If I close everything and open again, it is working just fine, until randomly stop working again.
I have tried other solutions as well but it always back to the same scenario.
It started happening after I had to delete the folder "C:\Users\xxxxxx\AppData\Local\Microsoft\VisualStudio".
I had to delete that folder because it freeze every single time I tried to open any project, the only solution that solve was deleting that particular folder.
After that the all projects open just fine, but I need to select the reference again and that when the problem starts.
It is a new project made in the current version of the visual studio, not a migration.

As suggested by #Sara Liu, I will mark
updating the visual studio to a version >= 15.5.5
As an answer to the problem.

Related

Visual Studio cannot start debugging for C++ project 0x80070057

Randomly (and infrequently), Visual Studio (2017) will abruptly refuse to run my C++ project. This will suddenly start happening in the middle of a session.
Visual Studio will still build the project and generate the executable, however, the following cryptic error message appears every time I want to run my program. No changes were made to the configuration or project and it strangely happens after an innocent build.
(It goes without saying but I tried extensively checking for solutions to this problem and no solution worked or was applicable)
Whether I add a new configuration setting or play with the existing settings (Release/Debug, x86/x64), nothing fixes it except performing a full repair (and that takes a very long time). Creating a new project didn't help either, but running it in VS 2015 is successful.
This happens approximately once a week, so I would greatly appreciate knowing how this error can be fixed (or at least avoided).
After some more experience with it, it appears just to be an issue with Visual Studio when builds are too large and executed too often (it happened to multiple computers). More specifically, it could come about as a result of using many templates and applying a large number of explicit template specializations. By building with only the template specializations I need for testing, the issue doesn't come up.
This is usually caused by VS mixing release and debug binaries for me. I have a script which cleans all the output directories, including the garbage VS puts into the projects .vs and Windows Temp folder. This always fixes the issue for me.

Visual Studio stopped recognizing any include files

So, I was randomly working on my project and visual studio 2017 was recognizing all my OpenCV stuff just fine, but randomly all of a sudden, it stopped recognizing it right while I was in the middle of coding it, there's errors all over the place saying that functions from OpenCV are undefined and that the source files cannot be opened, this literally makes no sense as it was just working and I had gotten stuff to compile and then all of a sudden in the middle of coding, it just will refuse to recognize anything, I'm really confused and I checked the include and library files and everything was just the same as it was when I had started out, I think something might be wrong with Visual Studio, but I have no idea what to do. I even tried restarting my computer to see if that fixed it, but I'm still stuck in the same boat :/
Edit: Interesting note, when I go to access the project properties, it no longer says properties, it just says properties, could it be a corrupt project?
Okay, so Richard Critten's suggestion of doing a chkdsk /f worked, I rebooted to have it check my main disk and now it oddly requires me to specify a folder in the include directory which I didn't have to do before which is odd, but now it's finally working and recognizing everything as it should. Thanks for the help, I just had never seen it before do that while in the middle of a project randomly which severely confused me.

Newly created items are not added to the solution until I close and reopen it (VS2017)

This is slowly driving me crazy. It is a problem I did not have with VS2015 and only showed up when I started using VS2017. I have upgraded to the first service pack and that did not change anything.
It is a C# .NET Core project if that matters. Any time I create a new file (e.g. Foo.cs) it doesn't seem to get associated with the solution. If I try and reference it from an existing file then the IDE doesn't recognize it and it reports an error. Any open tabs I have with these files shows them as "Miscellaneous files" where it would normally have "ProjectName(netcoreapp1.1)".
If I close the solution and then reopen it then everything works fine. Building or rebuilding the solution does not fix the issue. Is anyone else seeing this problem?

VS2015: Error List doesn't get cleared on new build

There are more than one C++ projects in a solution. Lets compile A, which will fail, and will have errors reported in Error List view. Now compile B (assume A is dependent on B), which will succeed. But, the errors rendered by compiling A doesn't go away.
Anyone encountered such issue? How to enable clearing the error-list view on each build (the way it is working for years). The Output window, however is clean on each new build.
Do you have 'Build Only' or 'Build + Intellisense' selected in the combo box? Many of my errors like this actually come from Intellisense (and tend to be bogus).
I currently have a similar problem with VS2015. I have a solution with c++ and c# wpf projects. Clean checkout, full build, no errors in Output but hundreds of errors appear in Error List. It reminds me of problems with earlier versions of VS back than the only fix was to close all open files but this time this is not helping either. In my case deleting the .suo file helped. See this for reference VS freaks out.
(edit) I read that Xamarin could cause the problem but uninstalling it and also uninstalling all the other addons delivered with VS2015 did not fix the problem. After a clean checkout and full build I got all the errors again.
On Visual Studio 2019, simply closing and restarting the application got rid of the warnings.

Trying to right click on code in VS2008 causes lockup

Working on a Win32 DLL using Visual Studio 2008 SP1 and, since yesterday, whenever I try to right click on code, to go to a variable definition for example, VS completely locks up and I have to manually kill the process. To make it even weirder, whenever this happens the devenv.exe process uses exactly 25% of the CPU. And I mean exactly, never 24%, never 26%, always 25%
Also, I've run ProcMon to see if devenv is actually doing something, but it's doing absolutely nothing external of the process. No disk, network, registry access. Nothing.
This is getting really aggravating because I have a large code base to deal with and the only other way of jumping to the definition is to first search for it.
Has anyone run into a similar issue? And, better yet, know a fix?
Edit: More info. Other projects (even an older version of the same one) work fine. I diffed the project file and the only differences is added source files and a /D define in the command line params.
Edit 2: So, it seems that now it's actually because intellisense is stuck updating. For some reason the status bar was disabled, but when getting it back I say "Updating Intellisense... (186)" and from what I've read, that 186 means that there are 186 background threads working. 186?! But, procmon still shows no IO whatsoever.
Try deleting all .sbr .bsc and .pdb files.
For the 25% CPU load: I guess it uses one core on your quad core machine.
If you have Visual Assist installed, try disabling it.
On connect, a submitted bug: Visual Studio Hang, seems to closely resemble your issue:
At random times, when I right click in the text editor, in this case C/C++ editor, Visual Studio will just hang. And if I wait it out, it still hangs.
It seems the workaround is to exit Visual Studio and delete the intellisense (.ncb) file in your project directory and reopen it.
The issue you are seeing is an intermittent failure in prior versions of Visual C++ that is hard to diagnose, and has a relatively simple workaround, as you have discussed, which is to delete your NCB. In order to get proper intellisense for header files, they would need to be included by a .cpp file in your project (directly, or indirectly through another header.)