Format Crashes

Grant FritcheyGrant Fritchey Posts: 72
edited June 8, 2010 8:26AM in SQL Prompt Previous Versions
From version 4.0.3.12. For some reason when I attempt to format code, I'm getting a crash with this information:

System.ApplicationException: Exception within progress task ---> System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.TextManager.Interop.IVsTextView'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{BB23A14B-7C61-469A-9890-A95648CED5E6}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at Microsoft.VisualStudio.TextManager.Interop.IVsTextView.GetSelection(Int32& piAnchorLine, Int32& piAnchorCol, Int32& piEndLine, Int32& piEndCol)
at RedGate.SQLPrompt.CommonVS.Editor.VSEditorWindow.get_Selection()
at RedGate.SQLPrompt.CommonUI.Refactor.Refactor.a(EditorWindowBase , Func`2 , Errors& )
at RedGate.SQLPrompt.CommonUI.Refactor.Refactor.a(EditorWindowBase , Errors& , Func`2[] )
at RedGate.SQLPrompt.CommonUI.Refactor.Refactor.a.Run()
at RedGate.SqlPrompt.Engine.Progress.TaskAggregator.Run()
at RedGate.SQLPrompt.CommonUI.Forms.ProgressDialogue.a()
--- End of inner exception stack trace ---
at RedGate.SQLPrompt.CommonUI.Forms.ProgressDialogue.ShowProgress(ITaskRunner task)
at RedGate.SQLPrompt.CommonUI.Refactor.Refactor.a(a )
at RedGate.SQLPrompt.CommonUI.Refactor.Refactor.LayOutSql(LayoutOptions layoutOptions, EditorWindowBase editor)
at b.Execute()
at a.Execute()
at RedGate.SQLPrompt.CommonVS.Commands.VSCommandControler.EnvDTE.IDTCommandTarget.Exec(String CmdName, vsCommandExecOption ExecuteOption, Object& VariantIn, Object& VariantOut, Boolean& Handled)

Comments

  • Anu DAnu D Posts: 876 Silver 3
    Many thanks for your post Grant.

    For some unknown reason, SQL Server Management Studio installations have been unravelling and deleting the interface that Prompt and Refactor need to get access to the query window.

    Running this from a Command Prompt should fix it:
    Code: regsvr32 "%commonprogramfiles%\microsoft shared\msenv\textmgrp.dll"

    Kindly let us know if this fixed the problem.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Anu DAnu D Posts: 876 Silver 3
    Grant,

    Did the above suggestion fixed the issue?
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Sorry I didn't get back to you sooner, I've been out of town. Yes, reregistering the DLL worked. I did have to modify what you sent me since I'm working on a 64 bit machine, but everything seems to fine again.
  • Anu DAnu D Posts: 876 Silver 3
    Thanks for confirmation.

    We are pleased that your issue is fixed!
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
Sign In or Register to comment.