Randomly when writing SQL queries in SSMS 2014, I'll get a popup that "Visual Studio has encountered an exception. This may be caused by an extension" along with a tip that I can run the application with the /log parameter and check the ActivityLog.xml file created somewhere in my user's AppData directory.
After this popup, IntelliSense stops updating, and toggling it on/off has no effect (any errors still underlined with red squiggly lines, etc, including their mouse hover popups remain indefinitely). Note that this happens even without any errors in my script.
But that's not really the issue, as I get the "Value does not fall within the expected range" error EVERY TIME I PUSH THE BACKSPACE KEY, although the Delete key works just fine.
This issue was not present until many months after I started using the application.
The workaround so far has been to copy the query into a new query window (immediately works), or to wait for it to randomly stop. So the issue is isolated to the query window.
Steps to reproduce:
There seems to be absolutely no commonality, since it has happened with all combinations of syntactically correct/incorrect statements, and long/short queries (ranging from a single SELECT statement to a multi-thousand line stored procedure). It also happens in statements not referencing any user-defined entities (e.g. selecting from the system tables).
Troubleshooting steps taken:
Looking at the log file, they may a two hour gap between the last message (larger time than I have been in the query window) and the exception caused by using the backspace key.
The following steps were performed by my company's IT department:
And later:
I seem to be the only one with this issue, as my company's IT department has not seen it before, and all Googling for this error message has been fruitless (I'm not using SSIS). It's been bugging me for over a month now and driving me crazy.
Thank you.
Update I am getting similar screwy behavior in Visual Studio 2013 when editing JavaScript, and it even threw an error which I think is the same as the first one thrown in SSMS before the backspace issue (but I clicked too fast and closed it before reading).
Sample Stack Trace in ActivityLog.xml
<entry>
<record>1172</record>
<time>2017/01/16 19:33:02.289</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>
System.ArgumentException: Value does not fall within the expected range.

at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)

at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)

at Microsoft.VisualStudio.NativeMethods.ThrowOnFailure(Int32 hr, Int32[] expectedHRFailure)

at RadLangSvc.SqlCompletionSet.GetTextTypedSoFar()

at RadLangSvc.Source.OnCommand(IVsTextView textView, VSStd2KCmdID command, Char ch)

at Microsoft.VisualStudio.Package.ViewFilter.HandlePostExec(Guid& guidCmdGroup, UInt32 nCmdId, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut, Boolean bufferWasChanged)

at Microsoft.VisualStudio.Package.ViewFilter.ExecCommand(Guid& guidCmdGroup, UInt32 nCmdId, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Package.ViewFilter.Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.Exec(Guid& guidCmdGroup, UInt32 nCmdId, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandFilterWrapper.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandFilterWrapper.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandFilterWrapper.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.VsTextViewAdapter.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.VsKeyboardFilter.SendCommand(Guid cmdGroup, UInt32 cmdID, Object inParam)

at Microsoft.VisualStudio.Editor.Implementation.VsKeyboardFilter.TextInput(TextCompositionEventArgs args)

at Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.<DispatchTextInputEvents>b__0(KeyProcessor p, TextCompositionEventArgs args)

at Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.<>c__DisplayClass1e`1.<Dispatch>b__1a()

at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)
</description>
</entry>
2019 update We upgraded to VS 2017 and SQL IntelliSense is behaving there like it did before. It just went full retard and spammed memory and CPU forcing me to use Task Manager to kill VS.
Version information:
Microsoft SQL Server Management Studio 12.0.4232.0
Microsoft Analysis Services Client Tools 12.0.4232.0
Microsoft Data Access Components (MDAC) 6.1.7601.17514
Microsoft MSXML 3.0 5.0 6.0
Microsoft Internet Explorer 9.11.9600.18537
Microsoft .NET Framework 4.0.30319.36373
Operating System 6.1.7601
The latest version is labeled Microsoft SQL Server Management Studio 18. Beginning with SQL Server Management Studio (SSMS) 18.7, Azure Data Studio is automatically installed alongside SSMS.
The issues could be directly related to SSMS installation or other dependency components. In rare cases, your Microsoft SQL management studio installation files are corrupted, and they require a repair or re-installation. You should always use the latest version of SQL SSMS on your computer.
SSMS 18.12. 1 is the latest general availability (GA) release of SSMS.
This is a bug with intellisense, which is present even in v18.5
Two workarounds:
Turn back on auto-list members (Options / Text Editor / All Languages / General)
If you want to keep auto-list members off, then when you get the error, hit [Ctrl]+[Space] to list members, this should repopulate intellisense object with data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With