Intermittently get blank screen when opening code file - visual-studio-2017

Sometimes in Visual Studio 2017, when opening a code-behind file, the page is empty.
If I close all the tabs, and reopen the same file from the Solution Explorer, the code will display.
Is there something about the way the project file is being saved, when tabs are left open, that might be causing this blank screen? Is there a way to close all tabs automatically when VS is about to shut down? Or a way to tell VS not to even bother to remember which files were open?

Related

VS2022 Community crashes when adding Class to MFC Dialog

I am facing a very consistent and persistent problem with Visual Studio 2022 Community Edition.
In an MFC project I open the Resource File and add a new Dialog. Then I place some standard controls and rename the dialog resource from its default name to a new ID.
Then I save and try to assign a Class to the dialog by right-clicking on the dialog and choosing 'Add Class'. Then the 'Add MFC Class' window appears, I enter the Class Name and click [OK].
It appears it creates the class on the File System and then VS2022 crashes completely!
I have disabled all addins in case an addin could be causing the problem but it happens every (almost) every time even without plugins. The only time I manage to get it to work is if I save, close all code editors, exit VS2022, restart it and immediately try to add the class. Another piece of information is that I have changed the MFC dialog template with a different one but it does not seem to bother it when I get it to work. Also intelliSense is completely disabled.
How can I debug this and identify the root cause of this crash?
There's a fair chance that you can't do anything in an effective fashion. VS2022 isn't an open source project, where you can easily pinpoint a crash to a specific line of code and fix it yourself.
But the good thing is that you don't need to. Just use the feedback channel VS2022 provides:
Usually a Microsoft employee will reply within a few days and maybe a fix will be included in the next preview version. Only now and then it can take some month to get a bug resolved.

How to make visual studio (2019) open new files always as a tab in the current window?

I often use various hotkeys to navigate files in a codebase using Visual Studio 2019:
ctrl+, lets me type a filename, and hitting enter opens that file
I have ctrl+a mapped to toggle between .cpp and .h files
I use ctrl+] to "go to definition", etc...
I also often use a split frame: my "workspace" consists of two views of files, side by side, and each has its own list of open tabs.
The behavior I would like to force is, if I use a shortcut to open a new file (or really attempt to open a file by any means...), it should open that file in the current frame.
In fact, that IS the behavior if either A. the current frame already has the target file in an open tab, or B. neither frame has the target file open in a tab.
But when the other frame has the target file in a tab, VS switches focus to the other frame and selects that tab.
This makes it very difficult to keep one frame open as a reference, and the other as an active development buffer, as VS keeps shuffling them from under me.

Visual Studio's bug: editor tabs (code tabs) appear->hide->appear forever => non-responsive

I love to open many tabs (10-30) of .cpp and .h, so the tab are overflowed to the right, i.e. Visual Studio can't show named of all opened tabs at the same time. (which is ok)
When I pin a new tab or change Visual Studio resolution (resize its window), Visual Studio will try to determine which one should be shown and which one should not (that is what I think).
In rare cases (1%), Visual Studio fail to do so. After I pin a new code tab (e.g. .cpp), it loops forever. For example, in the image, it is possible that the last of the four tabs will appear -> hide -> appear -> ... so on (forever).
Visual Studio would try to update other GUI to match the appearance/disappearance of the tab (e.g. width of console pane ?).
Within about 1-3 seconds, if I don't resize the window, Visual Studio will become unresponsive.
I will have to terminate it, lose some of my work.
It is like a mini-game.
I am sure that is a bug of Visual Studio. Have anyone faced it?
(Please comment if you faced the same problem!)
I don't think it is related to plugin "Visual Assist" or "Resharper".
I always set my monitor to low-resolution (1280 x 720), but I don't think it is a problem.
Question: How to solve this swappy bug, or at least avoid/alleviate it?

WebStorm editor endlessly cycles through "updating index"

I've installed the WebStorm 2016.2 editor. I opened one file, and now whenever I make any changes the window for that file the editor cycles through the following states:
When I modify the file a dialog with "Updating index" shows (with no cancel or other controls) running for about half a minute
Then there is a progress bar at the bottom of the editor, "Indexing", which goes to completion, taking about another half minute
After this any click on the file will repeat this cycle
I've tried invalidating the cache, restarting the editor, and also reverting any changes to the file, none of which makes a difference.
It turns out that I had accidentally excluded the file i was editing from the Webstorm project. When I undid that exclusion the problem went away.
I can only presume that Webstorm was detecting that the file hadn't been indexed, and therefore ran the indexer, but the exclusion meant it wasn't indexing the file. Thus the next time the file was touched it tried to run it again.

Turn off outlining permanently for VS2010 ( C/C++ )

For some reason I can't turn it off permanently. When I stop it manually from Edit->Outlining->Stop Outlining it's OK but once I close the file and open it again and it's on again. Disabled it in option->text editor->c/c++->formatting and nothing.
Tried editing the .vssettings file (or I'm editing wrong file? C:\Users\%current user%\Documents\Visual Studio 2010\Settings) but something is modifying it back again. I'm out of ideas :(.
Thanks in advance
Choose Tools menu > Options menu item.
Expand Text Editor then C/C++ and click on Formatting, set Enable Outlining to false
Note: you may need to reopen the file. The option is technically to enable outlining on file open.
In VS2013 it's not under Formatting. It's here:
Go to:
Tools/Options/Text Editor/C#/Advanced
And then just uncheck "Enter outlining mode when files open" checkbox.
And that's it. ;)
In VS2015 for C/C++ files it's here:
Options->Text Editor->C/C++->View->Enable Outlining