Author |
Topic |
|
MaxAbernethy
New Member
6 Posts |
Posted - Jun 01 2023 : 6:29:01 PM
|
Update: solved
Hi, starting yesterday VS hangs for about a second whenever I cut or copy. It doesn't matter what pane I do it in, eg. could be the text editor or find results or breakpoints. Same if I do Edit > Copy from the menu. The problem goes away if I disable visual assist. I updated to the latest version but it doesn't make a difference. The problem isn't present when I first start VS but begins after a minute or so.
VA_X64.dll file version 10.9.2491.0 built 2023.05.24 DevEnv.exe version 17.5.33530.505 Enterprise msenv.dll version 17.0.33530.505 Comctl32.dll version 6.10.22621.1635 Windows 11 11.0 22H2 Build 22621 36 processors (x86-64) Language info: 1252, 0x409 |
Edited by - MaxAbernethy on Jun 21 2023 2:11:42 PM |
|
feline
Whole Tomato Software
United Kingdom
19015 Posts |
Posted - Jun 02 2023 : 07:42:04 AM
|
How many files do you have in your solution?
If you open VA's Open File in Solution dialog (Alt-Shift-O) the title bar contains two numbers. The first number is the number of files currently listed, which changes as you filter the list. The second number is the total number of files in the list, which is normally the number of files in your solution. What is this second number?
I am wondering if you are working on a particularly large solution.
How do you know the IDE has hung? This might seem like a silly question, I am just trying to get a sense of what you are seeing. |
zen is the art of being at one with the two'ness |
|
|
MaxAbernethy
New Member
6 Posts |
Posted - Jun 02 2023 : 08:53:36 AM
|
Hey, thanks for your reply. My solution has 67k files, I'm working in UE. But this only started happening a couple of days ago, and I've been working in UE for years.
I did confirm that this doesn't happen in other solutions with fewer files, eg. one with 10k doesn't hang at all. Number of files open doesn't seem to matter, though.
What the hang looks like - nothing redraws at all, eg. no blinking caret - no response to clicks or typing until the hang ends. If I type a bunch of characters they'll appear over time after the hang, so I guess that the button presses are not processed until after the hang, rather than they're being processed but the graphics just aren't updating. - copied text doesn't reach the clipboard until the hang ends - if I cut, the cut text doesn't disappear until the hang ends |
|
|
feline
Whole Tomato Software
United Kingdom
19015 Posts |
Posted - Jun 05 2023 : 12:42:12 PM
|
Which version of VS2022 are you using? No sign of this here with version 17.6.1
Since this is a new problem I am wondering if an update to something could be a factor. Do you have any other extensions installed?
Does this happen if you copy or cut a comment, so no code?
If you disable VA via:
VAssistX -> Enable/Disable Visual Assist X
does this stop the delay from happening? It's possible that VA is just a coincidence and not a cause, and this is a simple test for this. |
zen is the art of being at one with the two'ness |
|
|
MaxAbernethy
New Member
6 Posts |
Posted - Jun 15 2023 : 2:08:34 PM
|
Hi, thanks for your reply.
The problem disappeared for a few days, but is now back, and worse than before. Visual studio hangs for 5-10s now, every time I try to copy. This happens no matter what I copy. It could be a comment, or the selection could be empty. It also doesn't have to be in the code editor. I could copy the name of a bookmark in the bookmarks window. Or a breakpoint from the breakpoints window.
Enable/Disable Visual Assist X doesn't change anything. But if I disabled VA from the extension manager and restart VS, the problem goes away. Then if I enable it and restart VS again, the problem comes back. I've opened an issue with MS from "Report a problem." But from experience, every time I do this, they see that I'm using Visual Assist and ask me to repro with it disabled. Since I can't, I expect they're not going to help me.
I noticed on the last restart that the problem only begins after the syntax coloring kicks in. So when I open the solution, the text is mostly white because VA isn't coloring it yet, and copy works fine. Then when the colors appear, copy gets slow.
I tried clearing temporary files and rebuilding symbol databases, deleting the project and re-syncing it from git. But the problem still repros.
This has become an urgent issue for me. I've been using Visual Assist for more than ten years, so I'm quite used to working with it, but it's become impossible and I simply have to turn it off to be productive.
Edited to add, I'm on VS 17.5.4. |
Edited by - MaxAbernethy on Jun 15 2023 2:10:59 PM |
|
|
MaxAbernethy
New Member
6 Posts |
Posted - Jun 20 2023 : 1:29:20 PM
|
Hi again, I have some more information to add.
- This is now affecting several of my colleagues. They've also found that disabling the Visual Assist plugin mitigates the problem. - There is some hang without VA, but it's much shorter, <1s. So I don't think VA is the root cause of the problem, but something about it makes the problem far worse. Can you think of any way in which VA might interact with the copy command? - The issue seems to be specific to UE 5.2+. It's not happening in other projects, not even earlier UE versions. - We've seen this on VS 17.6.3 as well. |
|
|
MaxAbernethy
New Member
6 Posts |
Posted - Jun 21 2023 : 2:11:07 PM
|
This has been root caused to Windows Defender. It detours some Windows APIs for copying to the clipboard. No idea what it's doing in there, or why it's worse with Visual Assist. |
Edited by - MaxAbernethy on Jun 21 2023 2:12:07 PM |
|
|
feline
Whole Tomato Software
United Kingdom
19015 Posts |
Posted - Jul 07 2023 : 10:52:19 AM
|
I am using Windows Defender here, and so far have not been able to reproduce the problem, which sadly doesn't offer any clues.
Is excluding devenv.exe from being scanned by Windows Defender an option? You may well have already done this, since you have worked out that Windows Defender is part of the problem.
It is tempting to suggest the size of UE 5.2 is a factor, but unless it is significantly larger than earlier versions of UE, I don't see why this would matter. |
zen is the art of being at one with the two'ness |
|
|
MaxAbernethy
New Member
6 Posts |
Posted - Jul 07 2023 : 11:27:32 AM
|
It was triggered by a policy rolled out by my company's IT department, which they've since reverted. When it was enabled, defender injected code into the copy functions, which scanned every file opened by devenv.exe. It's possible that VA made this slower by keeping a ton of files open, but I don't know.
In case this happens to anybody else, I was able to work around it by attaching a debugger to devenv.exe and setting function breakpoints on ole32.dll!OleSetClipboard at user32.dll!CloseClipboardStub before defender injects its code there. After it tries and fails to inject, the breakpoints can be removed. |
|
|
|
Topic |
|