visual-studio Visual Studio 2010:编辑器停止响应键盘

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3310033/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 12:14:08  来源:igfitidea点击:

Visual Studio 2010: Editor stops responding to keyboard

cssvisual-studiovisual-studio-2010intellisense

提问by Chuck Le Butt

I've got this very odd bug that appears to be a quirk in Visual Studio 2010: Sometimes, when moving the cursor into double quotes of a CSS style=""attribute the cursor refuses to move. I can't type anything, and the keys that respond are the UP/DOWNcursor keys and the DELkey (but not BACKSPACE).

我有一个非常奇怪的错误,它似乎是Visual Studio 2010 中的一个怪癖:有时,当将光标移动到 CSSstyle=""属性的双引号中时,光标拒绝移动。我无法输入任何内容,响应的键是UP/DOWN光标键和DEL键(但不是BACKSPACE)。

Typing does nothing, but pushing LEFT/RIGHTon the cursor keys produces the following error:

键入什么都不做,但在光标键上按LEFT/RIGHT会产生以下错误:

The operation could not be completed

操作无法完成

I've got no idea what's causing this, but I would hazard a guess that Intellisenseis getting very confused and bugging out.

我不知道是什么导致了这种情况,但我敢猜测Intellisense变得非常困惑和窃听。

At the moment, whenever this happens, I have to write any CSS outsite of the double quotes of the styleattribute and then place the cursor where I want the CSS to appear (using the mouse) and press CTRL-Vto paste it in. Very annoying :(

目前,无论何时发生这种情况,我都必须在style属性的双引号之外编写任何 CSS ,然后将光标放在我希望 CSS 出现的位置(使用鼠标)并按CTRL-V粘贴它。非常烦人: (

There must be a way of fixing this problem...?

一定有办法解决这个问题......?

Hopefully someone has an answer!

希望有人能给出答案!

采纳答案by Rob Quincey

Microsoft have had variations on this problem reported quite a few times via their support portal. Here is one postand if you scroll down you will see a comment with a bunch of other reports all detailing similar(ish) problems.

微软已经通过他们的支持门户多次报告了这个问题的变化。这是一篇文章,如果您向下滚动,您会看到一条评论,其中包含一堆其他报告,所有报告都详细说明了类似(ish)的问题。

Microsoft doesn't seem to be able to reproduce the problem but are "duping all the similar keyboard locking problems to a central bug, so that we can think a way to log the events if necessary". Which seems to be a generic response to a lot of these posts. Some people reported that it was simply becuase another window/pane/tab was in focus but I can see the OP obviously did not have this specific problem. Looks to me like one of those random unresolvable bugs. Hope I never get it! There's also numerous forum posts around the Internet, where users stated that removing certain 3rd party plugins has solved this issue.

微软似乎无法重现该问题,但正在“将所有类似的键盘锁定问题复制到一个中央错误中,以便我们可以在必要时考虑记录事件的方法”。这似乎是对很多这些帖子的通用回应。有些人报告说这只是因为另一个窗口/窗格/选项卡是焦点,但我可以看到 OP 显然没有这个特定的问题。在我看来就像那些随机无法解决的错误之一。希望我永远不会得到它!互联网上还有许多论坛帖子,其中用户表示删除某些 3rd 方插件已经解决了这个问题。

I just spotted this particular postwhich has a possibly useful comment on it for you (which also link to this SO post. As I do not have the bug I cannot test its validity for you. The main point of it seems to be something about the keyboard layout switching.

我刚刚发现了这篇特定的帖子,它对您可能有用的评论(也链接到这个 SO 帖子。由于我没有错误,我无法为您测试其有效性。它的要点似乎是关于键盘布局切换。

I'm sorry for putting all this into an answer when technically it is not an answer and just a mass of research, but there was no way this was gonna fit into a comment. And also sorry for pretty much link spamming, but again there was no way I could extract everythingthat they said into this post. I hope there is something useful in there for you :)

我很抱歉在技术上这不是答案而只是大量研究时将所有这些都放入答案中,但是这不可能适合评论。也很抱歉链接垃圾邮件,但我再次无法提取他们在这篇文章中所说的所有内容。我希望那里有一些对你有用的东西:)



EDIT: You should probably check the top rated answer below as this seems to solve a number of peoples issues, although I never had the Resharper plugin and still occasionally experienced this, but now I'm on VS2013 and have not had this problem re-occur, so maybe they fixed it...

编辑:您可能应该检查下面评分最高的答案,因为这似乎解决了许多人的问题,尽管我从未使用过 Resharper 插件并且偶尔也会遇到这种情况,但现在我使用的是 VS2013 并且没有再次遇到此问题-发生,所以也许他们修复了它......

回答by Erez Cohen

Just encountered the issue in VS 2012, in editing C#.
I noticed that the problem had occurred soon after the trial period of Resharper has ended and i inserted a valid license number. It also happened in only some of the source files.
The solution: Tools->Options->Resharper: Suspend.
Try typing - should work now.
Then: Tools->Options->Resharper: Resume.
Problem gone.

刚刚在 VS 2012 中编辑 C# 时遇到了这个问题。
我注意到问题是在 Resharper 的试用期结束后不久发生的,我插入了一个有效的许可证号。它也只发生在一些源文件中。
解决办法:工具->选项->Resharper:暂停。
尝试打字 - 现在应该可以工作了。
然后:工具->选项->Resharper:恢复。
问题消失了。

回答by Jerry

I have encountered this using Visual Studio 2013 and Resharper 8.2.1. None of the solutions provided in this thread worked (even suspending and resuming Resharper)

我在使用 Visual Studio 2013 和 Resharper 8.2.1 时遇到过这个问题。此线程中提供的解决方案均无效(甚至暂停和恢复 Resharper)

After contacting JetBrains support, it turned out to be a caching issue.

联系 JetBrains 支持后,结果证明是缓存问题。

Deleting all the files from the following directory solved the issue, as Resharper re-creates new caches:

从以下目录中删除所有文件解决了这个问题,因为 Resharper 重新创建了新的缓存:

C:\Users\[Username]\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches\[Project_reference]

回答by Mark Redman

I have some odd issues with the editor occasionally, a workaround for me is: 

编辑器偶尔会遇到一些奇怪的问题,我的解决方法是: 

Ctrl-Tab (x2) to another code file and back to the same code (or alt tab to another app and back, one of these two... can't replicate issue to be sure)

Ctrl-Tab (x2) 到另一个代码文件并返回到相同的代码(或 alt tab 到另一个应用程序然后返回,这两个中的一个......无法确定复制问题)

An ultimate solution might be a re-install.

最终的解决方案可能是重新安装。

回答by Robin Maben

Empty the solution cache folder

清空解决方案缓存文件夹

C:\Users\{UserName}\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches\

This was suggested by JetBrains supportwhen I contacted them.

这是JetBrains 支持人员在我联系他们时提出的建议。

回答by raz0r

Permanently fixing... Not too sure however I found that pressing pressing Ctrl+Shift+Caps Lock+Tab all at once seems to get rid of this and enables the mouse and keyboard again. I know this isn't the best of solutions but it works.

永久修复...不太确定但是我发现同时按下 Ctrl+Shift+Caps Lock+Tab 似乎可以摆脱这种情况并再次启用鼠标和键盘。我知道这不是最好的解决方案,但它有效。

回答by K4GDW

I have the same problem several times a day. I didn't notice it until I installed the web essentials extension. I just uninstalled it and will see what happens. I have tried reinstalling visual studio with no joy (but again, I didn't notice the problem until after I had already installed the various extensions).

我一天有好几次同样的问题。直到我安装了 Web Essentials 扩展程序,我才注意到它。我刚刚卸载了它,看看会发生什么。我尝试重新安装visual studio,但没有任何乐趣(但同样,直到我已经安装了各种扩展后,我才注意到这个问题)。

Sometimes, closing and re-opening the specific code window I'm working in fixes it. If that fails, sometimes I close all windows and reopen just the one I was actively editing. If all of that fails it usually requires a complete restart of visual studio.

有时,关闭并重新打开我正在使用的特定代码窗口可以修复它。如果失败,有时我会关闭所有窗口并重新打开我正在积极编辑的窗口。如果所有这些都失败了,通常需要完全重新启动 Visual Studio。

I find it funny that MSFT says that they can't duplicate the problem. Scott Guthrie experienced it first hand during his MVC4 beta demo hereat about 28 minutes in.

我觉得有趣的是 MSFT 说他们不能复制这个问题。斯科特格思里经历了第一手他MVC4测试中演示这里在约28分钟。

UPDATE:So far, as of 4-5-2012 9:33am Central Time, the problem hasn't recurred since uninstalling Web Essentials. This is the longest I've gone without this bug occurring. If I make it through the next 24 hours, I'll be confident in blaming Web Essentials.

更新:到目前为止,截至 2012 年 4 月 5 日中部时间上午 9 点 33 分,自从卸载 Web Essentials 后,该问题没有再次出现。这是我没有发生此错误的最长时间。如果我能熬过接下来的 24 小时,我将有信心责怪 Web Essentials。

UPDATE:4-6-2012 10:05am Central Time: Well, apparently it wasn't Web Essentials. It happened to me again this morning editing the contents of a block in my _Layout.vbhtml file. Closing the tab and reopening it fixed it.

更新:2012 年 4 月 6 日上午 10:05 中部时间:嗯,显然它不是 Web Essentials。今天早上我又发生了在我的 _Layout.vbhtml 文件中编辑块内容的情况。关闭选项卡并重新打开它修复了它。

回答by Caesar

I have the same problem on IDE, some times the Return key is not working at all... My solution is: CLEAN the project/solution.

我在 IDE 上有同样的问题,有时返回键根本不起作用......我的解决方案是:清理项目/解决方案。

BTW: CLEANing resolve also other unexpected behaviours after amendements on CSS or HTML.

顺便说一句:CLEANing 还解决了修改 CSS 或 HTML 后的其他意外行为。

回答by Mrchief

I frequently encounter this editor freeze, not just on CSS quotes but any file arbitrarily. I have a dual monitor setp and I have the doucment windows one one monitor and all tool windows on the next one. Sometimes, certain tool windows would freeze too (i.e. not respond to click).

我经常遇到这个编辑器冻结,不仅仅是在 CSS 引用上,而是在任何文件上。我有一个双显示器设置,我有一个显示器的文档窗口和下一个显示器的所有工具窗口。有时,某些工具窗口也会冻结(即不响应单击)。

Previously, I used to shutdown/restart IDE; but serendipitously, I discovered that switching to/from Full Screen mode, restores sanity. So now everytme I see a freeze, mode switching comes to rescue.

以前,我习惯关闭/重启IDE;但偶然地,我发现切换到/从全屏模式,恢复理智。所以现在每次我看到一个冻结,模式切换来救援。

Not sure if this will solve your issue, but worth a shot.

不确定这是否能解决您的问题,但值得一试。

Rant: In general, I find this new WPF based product very falky and unstable than its predeccessors.

Rant:总的来说,我发现这个基于 WPF 的新产品比它的前任产品非常不稳定和不稳定。

回答by Davy8

I tried every other workaround here but nothing seemed to work, and the issue was only present in one solution but not another.

我在这里尝试了所有其他解决方法,但似乎没有任何效果,并且问题仅存在于一个解决方案中,而不存在于另一个解决方案中。

Disabling Resharper fixed it temporarily but it came back after re-enabling it which wasn't a viable long-term solution.

禁用 Resharper 暂时修复了它,但在重新启用它后它又回来了,这不是一个可行的长期解决方案。

What worked for me was disabling all Resharper Extensions (Under Resharper -> Extension Manager). I was able to type again even after re-enabling all of them, so I'm unsure which extension specifically caused the issue, but that's another route to try for people who still have this issue.

对我有用的是禁用所有 Resharper 扩展(在 Resharper -> 扩展管理器下)。即使在重新启用所有这些扩展后,我仍然能够再次输入,所以我不确定是哪个扩展专门导致了这个问题,但对于仍然有这个问题的人来说,这是另一种尝试的途径。