visual-studio 视觉工作室复制粘贴错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3630874/
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:25:17  来源:igfitidea点击:

visual studio copy paste bug

visual-studiovisual-studio-2008visual-studio-2010

提问by Rana

when i hit ctrl + c without selecting anything (it should copy that line) and make some changes in the code then paste to another section, however the copied code is no longer there. im using visual studio 2010 and 2008, they both have this bug. anyone else noticed this bug?

当我点击 ctrl + c 而不选择任何内容(它应该复制该行)并在代码中进行一些更改然后粘贴到另一个部分时,但是复制的代码不再存在。我使用的是 Visual Studio 2010 和 2008,他们都有这个错误。还有人注意到这个错误吗?

回答by user133464

I have VS2010, same problem. The culprit? I had Remote Desktop open.

我有VS2010,同样的问题。罪魁祸首?我打开了远程桌面。

回答by JonWillis

Ctrl+C & Ctrl+V on a line without any selection, does copy the line for me in VS2008 and VS2010.

没有任何选择的一行上的 Ctrl+C 和 Ctrl+V 确实会在 VS2008 和 VS2010 中为我复制该行。

Have you tried, Ctrl+X, then Ctrl+V, this should cut and paste the line back in the same place, but have the line contents in your clipboard buffer like using copy.

您是否尝试过,Ctrl+X,然后是 Ctrl+V,这应该将行剪切并粘贴回同一位置,但将行内容保存在剪贴板缓冲区中,就像使用复制一样。

回答by Luferogo

I have experienced that problem before. In my case was a veeeeery simple explanation!
There is a shortcut of Ctrl+(Supror Ins) that also work to copy and paste. So, in my case, when I did the Ctrl+C, and then modified some code before the paste, I used very often the Ctrlkey, and the BeginEnd, those keys are next to the SuprInskeys, so what happened is I actually did other copy action (empty line) and when I pressed Ctrl+Pastethe clipboard was actually filled with the empty lines... ! :)

我以前遇到过这个问题。就我而言,这是一个非常简单的解释!
有一个Ctrl+(SuprIns)的快捷方式也可以复制和粘贴。因此,就我而言,当我执行Ctrl+ C,然后在粘贴之前修改了一些代码时,我经常使用Ctrl键,而BeginEnd这些键位于SuprIns键旁边,所以发生的情况是我实际上做了其他复制操作(空行),当我按下Ctrl+ 时Paste,剪贴板实际上充满了空行......!:)

Maybe you did not know the Ctrl+Ins+Suprshortcut to copy and paste and you are pressing that combination while modifying the code.

也许你不知道Ctrl+ Ins+Supr快捷方式,复制和粘贴,你是按该组合在修改代码。

Hope that is your situation :)

希望这是你的情况:)

回答by NeoShow

Try closing all code/class/form windows - then opening them up again. I found that Copy and Paste worked on some code windows, but not others.

尝试关闭所有代码/类/表单窗口 - 然后再次打开它们。我发现复制和粘贴在某些代码窗口中有效,但在其他窗口中无效。

Note: I had some extensions installed which bugged out, but I only saw the error message when I closed certain code windows.

注意:我安装了一些错误的扩展,但我只在关闭某些代码窗口时看到错误消息。

回答by Karthikeyan VK

I had the same copy paste problem in vs2017 and i reset the keyboard shortcuts. Resharper the culprit.

我在 vs2017 中遇到了同样的复制粘贴问题,我重置了键盘快捷键。重整罪魁祸首。

Tools -> Options -> Search for keyboard(in search options) and click on Reset button.

工具 -> 选项 -> 搜索键盘(在搜索选项中)并单击重置按钮。

enter image description here

在此处输入图片说明

回答by Ben

Restarting Visual Studio was a fix for me

重新启动 Visual Studio 对我来说是一个修复

回答by jp2code

I'd like to post a video example of this happening.

我想发布一个关于这种情况的视频示例。

It was happening yesterday, so I completely shut down my PC when I left work last night, so this morning was a nice, fresh Windows 7 boot.

这是昨天发生的,所以我昨晚下班时完全关闭了我的电脑,所以今天早上是一个很好的、全新的 Windows 7 启动。

I am not working across Remote Desktop.

我不在远程桌面上工作。

https://www.youtube.com/watch?v=h3qMRma3EZQ

https://www.youtube.com/watch?v=h3qMRma3EZQ

Is there a way to embed a YouTube video?

有没有办法嵌入 YouTube 视频?

回答by kilad

Running VS2010, and same problem. All sorts of copy/paste errors (as in the title of the question). The culprit? I had Jumi Controller running. I killed the jumi.exe process, and all was back to normal.

运行VS2010,同样的问题。各种复制/粘贴错误(如问题标题所示)。罪魁祸首?我让 Jumi Controller 运行。我杀死了 jumi.exe 进程,一切都恢复了正常。

回答by angiestardust

I have noticed this when I open the page I'm working on in the browser (right click anywhere in the page and choose "View in Browser"). As soon as I close the browser, copy and paste is restored.

当我在浏览器中打开我正在处理的页面时,我注意到了这一点(右键单击页面中的任意位置并选择“在浏览器中查看”)。一旦我关闭浏览器,复制和粘贴就会恢复。

回答by lincolnk

i've run into this before with vb code files. i don't have to do work in vb that often, so the easy solution was to train myself to do copy and paste operations without intermediate actions. i don't recall ever having this issue with c#.

我以前用 vb 代码文件遇到过这个问题。我不必经常在 vb 中工作,所以简单的解决方案是训练自己在没有中间操作的情况下进行复制和粘贴操作。我不记得在 c# 中遇到过这个问题。