Re: unhandled exception in SSMS for query from Reistered Servers

Not sure if this is a ViEmu thing or not and it is pretty benign, but I thought I'd post it anyway...

If the first query window I open after starting up SSMS is from the Registered Servers tab, right after I close the ViEmu splash/dialog box I get an unhandled exception:

************** Exception Text **************
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.SqlScriptEditorControl.MultiServerPropertiesDisplay.SetChildState(UIConnectionInfo childInfo, String state).......

If the first window is from the Object Explorer - no problem. If I then open a query from window from Registered Servers, no problem.

Since the first thing I do in the morning is run a query across all the servers and my coffee hasn't kicked in yet - I see this message almost every morning. Any ideas on to fix it?



Re: unhandled exception in SSMS for query from Reistered Servers

wgh, it's very unlikely this is caused by ViEmu, although, of course, one can't completely rule out the possibility. It looks more like a .NET exception than anything else, and ViEmu is native code (not .NET).

In any case, it should be easy to find out by uninstalling or otherwise disabling ViEmu. The easiest way to do this without uninstalling is to go to this registry key:


And rename it to something else (I just prepend an underscore to the "{1A...}" name). When you start SSMS, or try to bring up the Tools|ViEmu Settings dialog, SSMS will complain and offer to permanently remove the add-in, to which you should respond "no" to be able to restore it later. In any case, this way ViEmu won't be there, and you will be able to check whether the above exception still happens. Let me know the result.

I've tested it with SQL Server 2008 (you don't mention the exact version). Everything should be equally applicable to SQL Server 2005, though.


  - Jon


Re: unhandled exception in SSMS for query from Reistered Servers

Hi Jon,

I renamed the key in the registry and tried to recreate it but couldn't get the exception to happen. When I set the registry key back to {1A1E...}, I get the exception immediately after I press Okay on the "Welcome to ViEmu" splash screen.

I'm using SSMS 10.0.1600.22 ((SQL_PreRelease).080709-1414 ). It only happens when I click "New Query" against a folder on the Registered Server tab. If I right click, New Query" against a specific instance it does not throw the exception. Also, once I've opened a Query window, opening a new query against a folder will not generate the exception.

Hope this helps, in the meantime I just open a query against an instance before I switch to the Registered Servers tab. Thanks for the tip on renaming the key - that's much nicer than uninstalling/reinstalling the entire app.



Re: unhandled exception in SSMS for query from Reistered Servers

Ok Greg. so it does seem it is due to ViEmu somehow. I'll be happy to try to reproduce it and fix it as soon as I can.

Can you please tell me what SQL Server version that version string correspond to? Is it 2005, 2008, or some other preview version?

Best regards,

  -- Jon