It appears that VS is generating a Windows Error Report (WER) event when a .sql file window is closed:
Fault bucket , type 0
Event Name: VisualStudioNonFatalErrors2
Response: Not available
Cab Id: 0
Problem signature:
P1: devenv.exe
P2: 15.0.26430.12
P3: vs.platform.hwndwrapper.destroy-window-error
P4: unknown
P5: Microsoft.VisualStudio.Shell.15.0
P6: Microsoft.VisualStudio.PlatformUI.HwndWrapper.DestroyWindowCore
P7: unknown
P8: unknown
P9: unknown
P10: unknown
These correlate to each attempt to close a window. Unchecking the build/deploy boxes in the Build Configuration Manager don't seem to help (I'm running VS 2017 Enterprise).
Running procmon shows an 11 second delay on my machine in closing a single window after the handle to wermgr.exe is closed:
12:19:31.2071581 AM devenv.exe 6564 CloseFile C:\Windows\SysWOW64\wermgr.exe SUCCESS
12:19:32.7423468 AM devenv.exe 6564 Thread Exit SUCCESS Thread ID: 16288, User Time: 0.0000000, Kernel Time: 0.0000000
12:19:36.6511179 AM devenv.exe 6564 Thread Create SUCCESS Thread ID: 8576
12:19:38.1531428 AM devenv.exe 6564 Thread Exit SUCCESS Thread ID: 8576, User Time: 0.0000000, Kernel Time: 0.0000000
12:19:42.7939996 AM devenv.exe 6564 Thread Create SUCCESS Thread ID: 12052
12:19:42.7952451 AM devenv.exe 6564 Thread Exit SUCCESS Thread ID: 12052, User Time: 0.0000000, Kernel Time: 0.0000000
12:19:42.7953980 AM devenv.exe 6564 Thread Create SUCCESS Thread ID: 6892
12:19:42.7984705 AM devenv.exe 6564 RegQueryKey HKLM SUCCESS Query: HandleTags, HandleTags: 0x0
This appears to be a product bug with no known workaround at this time.
.sql
files. You will be better off using even theNotepad++
. Like literally, I have never seen a tool which would handle thesql
files worse than Visual Studio. – Browning