Visual Studio 2019 keyboard stops responding or continously repeats characters - visual-studio

Using Visual Studio 2019 Enterprise (v16) (with Resharper and StyleCop extension for Resharper installed) regularly has the following issues with the keyboard (many times per day).
Keys entered on the keyboard are not input
Keys entered on the keyboard get input in the wrong order (even typing slowly), like this:
Keys entered (including CTRL+V) get repeated continuously, like this:
The only way to temporarily resolve it is to close visual studio and re-open where it will work fine for 5-60 minutes before the problem reoccurs.
Steps taken:
Replace the cheap external keyboard with a more expensive one (Logitech G213)
Unplug all USB devices except for mouse and keyboard
Reinstall Visual Studio
None of these steps have resolved the issue.
I have not yet tried uninstalling Resharper/Stylecop as I do require these for my every day work.
Has anyone seen/solved this problem before?

See the link from the ReSharper forums. This shows a workaround and a response. I also saw the empty document issue reported there too.
I'm going to give it a try or rollback if necessary.

This sometimes happens when an extension (typically a code analyzer) crashes with an exception (indicated by a status bar on top of the code window) while typing.
A workaround seems to be to open a pull-down menu, such as the File menu, and close it again.
I would call the resulting keyboard behavior a bug in Visual Studio, but the original cause is also always a bug in the extension you are using. You may therefore want to report it to both Microsoft and the developer of the extension. Note that this is my personal opinion. I do not work for Microsoft.

Related

Visual Studio 2022 duplicate shortcut has changed

Microsoft Visual Studio Community 2022 (64-bit)
Version 17.0.6
I have been using Ctrl+D for years in Visual Studio however today duplicate no longer works. This has been working in vs 2022 for several months.
When I check the edit menu it shows Ctrl+E,V
I also noticed Alt+Up Alt+Down no longer work to move lines.
Any ideas how these shortcuts can be reset or what may have caused them to change?
I managed to fix the issue by clicking reset mapping scheme.
Tools
Options
Environment
Keyboard
Reset
No idea how they got messed up in the first place because I have never touched these settings. Perhaps it was an extension.
My scheme still showed (Default) before clicking reset.
I'm using version 17.2.3 of Visual Studio Community. Going in and doing a reset didn't do anything for me. I found that Ctrl-C, Ctrl-V was the only thing that worked on a WinForm to duplicate either a single control or multiple controls.

Visual Studio 2015 Crashes While Moving Tabs or Sorting Internal Windows

Visual Studio 2015 suddenly crashes while moving any internal window to another place (Toolbox - Solution Explorer), or moving tabs to another window that already has tab in the second monitor.
If moving opened tab to another monitor it working good but once move the second tab beside it, It crashes.
I've uninstalled it and re-installed but the issue still.
I made all commands here Visual Studio 2015 crashes .. but nothing help
#Sergey Vlasov .. Thanks a lot .. Fixed after following these steps
Edit %InstallRoot%\Common7\IDE\devenv.exe.config
Edit %LocalAppData%\Microsoft\VisualStudio\14.0_xxx\devenv.exe.config .. Actually for me after added the following line in the first config file it was added to the second file automatically.
Append the following text to the AppContextSwitchOverrides element’s value attribute:
;Switch.System.Windows.Interop.MouseInput.OptOutOfMoveToChromedWindowFix=true;Switch.System.Windows.Interop.MouseInput.DoNotOptOutOfMoveToChromedWindowFix=true
After restarting VS, you should be able to drag your VS windows around without crashing.
However, based on feedback provided by users who have tested this workaround, it might not resolve the issue on systems where KB4598299 was installed.
Most probably caused by recent Windows 10 updates: https://www.bleepingcomputer.com/news/microsoft/recent-windows-10-updates-cause-visual-studio-wpf-app-crashes/

How to cut/paste in Visual Studio 2010 with Emacs emulator

I downloaded the emacs emulator for Visual Studio 2010, and everything seems to work fine and dandy -- except cut and paste!
I can delete regions by setting a mark (CTRL-Space) and then delete it with CTRL-W. But it seems that it never goes to the kill ring -- if I try CTRL-Y to yank it, then nothing happens.
Curiously enough, if I delete a line with CTRL-K, then the deleted line goes to the kill ring.
Visual Studio's keybinding menus suggest that CTRL-W should be cut and CTRL-Y should be paste, so this seems to be something wrong with the emulator.
Has anyone had a similar problem, or know how to cut/paste with emacs emulation on?
This is a known bug and Microsoft has declined to fix it. See: http://connect.microsoft.com/VisualStudio/feedback/details/672582/emacs-mode-cut-copy-paste-errors
This is the bug that I submitted. At one point I had Ctrl-w/Ctrl-y working internal to Visual Studio, but never externally. I was fiddling with exporting/importing settings and it started working. Now I've had to reset Visual Studio and it's not working again, and no amount of fiddling will get it back to where I was. Sigh.
So whenever I have to do some serious cut/paste work, especially between the code and some other window, I just save the file in VS and open up Emacs, do the editing in Emacs, then save the file in Emacs. When I go back to VS it asks if I want to reload the file. A click on "Yes" in I'm back working in VS, ready to compile or whatever.
I discovered that dragging and dropping text selections from other applications, into VS2010 with the emacs package installed, DOES work. Your mileage may vary.

Visual Studio 2010 hangs when opening websites

My Visual Studio 2010 Professional hangs up 99.999% of the time when I try to open a website as "Remote Site" through an HTTP address. However if i open the site through a unc path instead of through HTTP, it works fine. Of course that is not always feasible, for example when working from offsite. The same sites (assuming they are not NET40 sites) work fine in Visual Studio 2008, so I'm pretty sure it is not a problem with the Front Page Server Extensions.
If i run 2010 in /safe mode, it opens the projects fine. So i figured maybe it was one of my installed extensions. I therefore disabled all my extensions and tried again, but it still hangs up. So it is apparently something in Visual Studio itself that is different between safe and normal modes.
I ran it in logging mode, and checked the log but did not see anything that stuck out to me. The log is uploaded here: http://pastebin.com/aUnVanB1 .
The exact symptoms I am seeing are that when i click on the project name, it pops up and asks me for my credentials. I enter those, and click OK, and it then loads the solution explorer, and i see the tree view, but then it just hangs with the progress dialog that says "Preparing Solution...". The progress bar keeps cycling, but it never finishes loading, and the spot where the properties window would be in the VS UI is completely unpainted, with just a blank, empty, white space.
Any one have any clue what else i could do to try to figure out why 2010 hangs when attempting to load websites via HTTP? Thanks!
Thanks for your question... you gave me the right clue to solve my problem!
My VS 2010 was hanging (in fact was very slow to get available) when I was openening a solution containing a remote website and I was due to press Escape a few times to cancel the pending operation... As you suggest I tried to open such a solution with /safeMode and VS2010 became available quite instantly.
So as you pointed the VS Extensions... I checked mine (all from Telerik): opening the extension manager I discovered that some updates where available. I thought the extensions updates were automatically proposed and so never checked that before. In fact, you need to manually check with the extension manager if some are available.
I've updated all my Telerik extensions... and now I may open normally all solutions including a remote website.
Thanks a lot! Perhaps... you need to updates your extensions???
Check you network order preference in Windows.
I had a similar problem where DNS would cause a hang of 1 minute before trying again (and again and finally on the next network).
Under Network, Advanced Settings (WinXP):

Visual studio forgets window settings and makes a mess

I have this problem where I open Visual Studio and the internal windows are scattered all over the place. None of them are docked; some that should be visible have become invisible and vice versa. I then have to spend ages getting the windows back where I like them.
It only seems to happen with some solutions and only appeared recently.
For the life of me I can't fix the problem. Has anyone else been through this?
Sounds like there is definitely a problem with Visual Studio retaining your settings between round-trips and possibly your Visual Studio settings profile in general.
The solution I'd recommend is firstly to reset all settings, secondly customize things to your personal preference and finally take a backup of those customized settings. The idea is that this settings backup file can be used later to automate a quick settings restore to a point you are happy with. The following steps show how to do this and hopefully should sort out even the most confused Visual Studio setting issues:
Close down all instances of Visual Studio.
Go to Start > Programs > Visual Studio 200X > Visual Studio Tools > and choose 'Visual Studio 200X Command Prompt'
Run the sligthly less well known 'devenv.exe /ResetUserData' command. With this command you will lose all of your Visual Studio environment settings and customizations. Because of this, the /ResetUserData switch is not officially supported and Microsoft does not advertise it (the switch is not described in the help for devenv.exe you get when you type devenv.exe /? in a command prompt). Importantly, wait for the resulting devenv.exe process to disappear from Task Manager or even better Process Explorer.
When the process disappears from Task Manager or Process Explorer, run 'devenv.exe /ResetSettings' which will restore the IDE's default settings and eventually start a single instance of Visual Studio.
Now in Visual Studio choose 'Import and Export Settings...' near the bottom of the 'Tools' menu to start the Import and Export Settings Wizard.
Choose 'Reset all settings' radio button and Next > Choose 'No, just reset settings, overwriting my current settings' and Next > Choose your personal 'Settings Collection' preference, I would choose Visual C# Development Settings here (Note: What you choose here has an effect on keyboard shortcuts etc. but you can always repeat this process until happy) and click Finish.
When you get the message that 'Your settings were successfully reset to XXXXXX Development Settings.' click Close then spend a good bit of time adding any personal customizations to Visual Studio such as opening windows you always want open, customizing toolbars and adding any toolbar buttons etc.
When you are finished with your personal customization and completely happy with your setup go again to Tools > 'Import and Export Settings...'
Choose 'Export selected environment settings' radio button and Next > Tick 'All Settings' and Next > Choose a file name and directory and click Finish to store a backup of your current settings in a .vssettings file.
In future if things go haywire again head back to Tools > 'Import and Export Settings...' and this time choose 'Import selected environment settings' radio button and Next > Choose 'No, just import new settings, overwriting my current settings' and Next > Either choose the name of your .vssettings file from the list (usually under the My Settings folder) or Browse.. to where you saved the file and Next > Tick 'All Settings' and click Finish.
Importantly, close the single instance of Visual Studio. Any future instance you open should retain your latest customizations.
Visual Studio corrupts its settings with regular monotony (always has done, I've been suffering from this since the Visual C++ days, and it's still a bugbear in VS2013).
Often this seems to be totally at random, but it's highly probable after a crash.
It will also lose any changes to your settings if Visual Studio doesn't shut down cleanly - for some reason instead of saving back the settings when you OK the dialog, VS seems to wait until it quits to write back your changes, so after changing options I always quit and restart to ensure the changes have been flushed to disk. Similarly you should never change options with 2 or more instances of VS running, as the last one to quit will overwrite the settings.
In particular, there is an easily reproducible case: If you launch two or more copies at the same time (by which I mean if you start up two or more copies, so they are all initialising at the same time), they seem to fight over the settings file and it becomes corrupted or resets to defaults.
The best two workarounds I've found are:
Never launch more than one instance at a time. If you need to run several instances concurrently, then wait for the first one to finish loading its Solution before you start to launch the next.
Always use Tools > Import and Export Settings to save your settings to a backup file, so that recovering from this corruption only takes a few seconds each time it happens.
Another smaller, but still rather irritating habit is that if VS is minimised when it is quit (e.g. by shutting down), it corrupts its window position information and the next time you run it, it will be maximised.
I had a similar issue when the My Documents folder was stored on a mapped drive. If I opened VS before mapping the drive, VS would act as if it was the first time it had been opened. I solved this issue by storing the environment settings on the local disk.
I just ran into this problem too (seemed to trigger after a windows update) where I kept getting some bogus window layout no matter what I did. The above suggestions didn't work either. But luckily the suggestions in: Why doesn't VS 2008 IDE remember my preferences? of deleting:
%APPDATA%\Application Data\Microsoft\VisualStudio\9.0\windows.prf
worked.
TP
Actually I worked out what the culprit was: previous VS crashes.
If one of my Visual Studio instances crashes for whatever reason - the next time I start up VS, I get a weird batch of settings. The behaviour depends on various factors, like whether or not I had other instances of VS open at the time.
I tried Peter McG's solution, still didn't help.
What ended up working for me was to delete my VS Solution User Options (.sou). Located in the same directory as my solution.
Only bad thing is you have to redo all of your settings. This included my exception changes. Not to much to change, but if you have a lot of customization it could be a real pain.
There must be something in that file messing everything up, but deleting the whole file is quick and easy.
Which solution you're opening shouldn't matter because those settings are not solution-specific. But I wonder do you maybe have Visual Studio 2005 and 2008 installed? If so, opening a solution created in 2005 will open VS 2005 and opening a 2008 solution will open VS 2008. You may have VS 2005 even if you didn't install it. For example, InfoPath 2007 installs a VS 2005 shell.
First I would position the windows where you want them, then do a Tools -> Export Settings and include only the window layouts. That way you at least have something you can revert to.
Then I would check Tools -> Options -> Import Export Settings and make note of where the "Automatically Save My Settings To This File" path is set to. Keep an eye on that file. Do you have any sync software that may be inadvertently overwriting it? Does it point to a non-existing location?
My issue is similar, but the result is the app crashes. The problem was this value
In HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\MainWindow. It was set to "0 1000 -280 -100 3" probably due to having multiple screens and moving the UI around a lot.
Deleting this value allowed the app to restart successfully. It gets recreated on startup.
I'm facing similar issue. And it also only started recently, like, within the last 30 days or so. The only thing I remember changing in this period was updating Resharper 4.5.
I have experienced something similar. In my case the text editor colors (c# editor for example) are going haywire. The only solution that I tried and works for me is change color theme so something else and then back to what I want.
In my case its not the Window layout being corrupted but Intellisense offering code completion and pop-up help. Never had this issue for the last decade, now it happens 3 times a day at least. Win8.1, Visual Studio 2013, ReSharper 8 and now ReSharper 9 (in hopes the upgrade would fix it).
I now routinely have to
close the solution,
Tools/Import-Export Settings/Reset all settings
Close Visual Studio
Open Visual Studio Import my saved settings
RE-open the solution and continue working
I can then work fine again for quite some time until something goes awry... lets say a stack-overflow while I'm debugging. At that point I just know my settings are screwed and my Intellisense is dead again.
I'm starting to wonder if it isn't something to do with a latest Visual Studio update. There are things in there I never use like the advertising crap and Office development integration. MS Office has its own issues, like Office 64 bit not being seen by any other application such as Quicken as an installed email program. Or maybe its a conflict with ReSharper which wants to overtake and 'extend' the Intellisense feature.
Either way, I'm sure its a different manifestation of the same issue: Visual Studio settings are going sideways during normal use.
I just came across this issue in VS 2012, reset window layout was doing nothing.
I extrapolated
%APPDATA%\Application Data\Microsoft\VisualStudio\9.0\windows.prf
to
%appdata%\Microsoft\VisualStudio\11.0\Windows.index
... deleted it and was back in business!
Make sure you close all instances of VS first!

Resources