Visual Studio Hangs when closing .SQL files
C

3

13

I have all extensions disabled, and only 1 Sql Project open. Yet Visual Studio hangs whenever I close a SQL file.

Versions affected:

  • 2017 Enterprise
  • 2015 Enterprise

During this "hang time" Visual Studio possesses a Not Responding status.

It also appears that the amount of time it stays locked is correlated to the number of files being closed/are open.

EDIT: Reproducable with devenv in SafeMode

Thoughts?

Carob answered 15/5, 2017 at 15:52 Comment(3)
Have you tried devenv /SafeMode? Another option would be to attach another Visual Studio to the first one to check the callstack while you close the first one, maybe it is connecting to somewhere and getting timeouts.Kishakishinev
SafeMode produces the same result. I've used a connection monitor to see if it was reaching outward and hanging. But no dice. Great idea though!Carob
Visual Studio is the worst tool for working with the .sql files. You will be better off using even the Notepad++. Like literally, I have never seen a tool which would handle the sql files worse than Visual Studio.Browning
L
23

Open MS Ticket: https://developercommunity.visualstudio.com/content/problem/67789/visual-studio-hangs-when-closing-sql-files.html

The real solution will come with an update from MS. For now, however, turning off my participation in the ‘Visual Studio Experience Improvement Program’ seemed to solve it.

You can check whether or not you're signed up for this program by clicking on Help -> Send Feedback -> Settings (in 2017, not sure about 2015).

EDIT: A ticket with Microsoft is open and can be found here:

https://developercommunity.visualstudio.com/content/problem/67789/visual-studio-hangs-when-closing-sql-files.html

Lowe answered 12/6, 2017 at 19:8 Comment(6)
Amazing. Great find brother!Carob
@RuslanK. happy to hear this helped someone else!Carob
You rock! This has been driving me nuts for weeks.Overturf
What a ripper! This is still an issue with the latest update (15.3).Inoperable
Still an issue in 15.4. It also seems to affect the closing of solutions (or unloading of projects) when sql files are open.Mote
Genius - thanks! Visual Studio Experience Improvement achieved.Noctambulous
B
0

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.

Bertrand answered 7/6, 2017 at 6:36 Comment(2)
Amazing insights my man. Perhaps we should replicate this thread in the VS errors forum?Carob
I'm pretty new here... not sure the best way to do that.Bertrand
B
0

The workaround for me was:

  1. Updating these extensions:

    • ReadyRoll for VS2017
    • SQL Prompt Core
  2. Disabling/re-enabling the following extensions on VS 2017 Enterprise:

    • ReadyRoll for VS2017
    • SQL Prompt Core
    • SQL Search

While I was trying to figure out which extension was causing the hang, I couldn't identify the specific one. Anyway, this approach worked and I have all three extensions enabled now.

This is all very strange, because I left my workstation turned on on last friday, with VS opened. And this monday morning it just started hanging when trying to open any .sql file, even when the file was empty.

Break answered 11/9, 2017 at 10:50 Comment(1)
I had to disable SQL Server Data Tools - Sql Editor and all worked wellCavesson

© 2022 - 2024 — McMap. All rights reserved.