Exception when in different user context
BAlexandrov
Posts: 14
Greetings,
We recently bought SQL Prompt and it is satisfactory overall but there is one nasty problem.
I often have to run SQL Management Studio with different user (with sysadmin access to sql server) through runas functionality. Often SQL Prompt gives this exception when tries to access database and does not work. Probably it needs some permissions but I cannot find where. We are in a Windows 2003 domain, both currently logged on and supplied with runas accounts are administrators of the machine. I have installed also Visual Studio 2005.
We recently bought SQL Prompt and it is satisfactory overall but there is one nasty problem.
I often have to run SQL Management Studio with different user (with sysadmin access to sql server) through runas functionality. Often SQL Prompt gives this exception when tries to access database and does not work. Probably it needs some permissions but I cannot find where. We are in a Windows 2003 domain, both currently logged on and supplied with runas accounts are administrators of the machine. I have installed also Visual Studio 2005.
************** Exception Text ************** _5: Exception of type '_5' was thrown. at RedGate.SqlPrompt.Engine.Cache.MetaDataCache._1() at RedGate.SqlPrompt.Engine.Cache.MetaDataCache.SaveToFile(String filename) at RedGate.SqlPrompt.Engine.Cache.MetaDataCache._1(String ) at RedGate.SqlPrompt.Engine.Cache.MetaDataCache.set_AutoRefreshOnFirstRetrieve(Boolean value) at RedGate.SQLPrompt.CommonUI.Forms.CacheManagementForm._8(Object , EventArgs ) at System.Windows.Forms.CheckBox.OnCheckedChanged(EventArgs e) at System.Windows.Forms.CheckBox.set_CheckState(CheckState value) at System.Windows.Forms.CheckBox.OnClick(EventArgs e) at System.Windows.Forms.CheckBox.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- AppIDPackage Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/AppIDPackage.DLL ---------------------------------------- System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- Microsoft.SqlServer.SqlTools.VSIntegration Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.SqlTools.VSIntegration.DLL ---------------------------------------- Microsoft.VisualStudio.Shell.Interop Assembly Version: 7.1.40304.0 Win32 Version: 7.0.4054 CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.VisualStudio.Shell.Interop/7.1.40304.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Shell.Interop.dll ---------------------------------------- Microsoft.VisualStudio.OLE.Interop Assembly Version: 7.1.40304.0 Win32 Version: 7.0.4054 CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.VisualStudio.OLE.Interop/7.1.40304.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.OLE.Interop.dll ---------------------------------------- System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- Microsoft.SqlServer.SqlTDiagM Assembly Version: 9.0.242.0 Win32 Version: 9.00.1399.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.SqlTDiagM/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.SqlTDiagM.dll ---------------------------------------- Microsoft.DataWarehouse.SQM Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.DataWarehouse.SQM.DLL ---------------------------------------- Microsoft.SqlServer.Instapi Assembly Version: 9.0.242.0 Win32 Version: 9.00.1399.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.Instapi/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.Instapi.dll ---------------------------------------- RedGate.SQLPrompt.SSMSUI Assembly Version: 3.0.0.868 Win32 Version: 3.0.0.868 CodeBase: file:///C:/Program%20Files/Red%20Gate/SQL%20Prompt%203/RedGate.SQLPrompt.SSMSUI.dll ---------------------------------------- Extensibility Assembly Version: 7.0.3300.0 Win32 Version: 7.00.9466 CodeBase: file:///C:/WINDOWS/assembly/GAC/Extensibility/7.0.3300.0__b03f5f7f11d50a3a/Extensibility.dll ---------------------------------------- EnvDTE Assembly Version: 8.0.0.0 Win32 Version: 8.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC/EnvDTE/8.0.0.0__b03f5f7f11d50a3a/EnvDTE.dll ---------------------------------------- RedGate.SQLPrompt.CommonUI Assembly Version: 3.0.0.868 Win32 Version: 3.0.0.868 CodeBase: file:///C:/Program%20Files/Red%20Gate/SQL%20Prompt%203/RedGate.SQLPrompt.CommonUI.DLL ---------------------------------------- RedGate.Licensing.Client Assembly Version: 1.3.0.25 Win32 Version: 1.3.0.25 CodeBase: file:///C:/Program%20Files/Red%20Gate/SQL%20Prompt%203/RedGate.Licensing.Client.DLL ---------------------------------------- RedGate.SQL.Shared Assembly Version: 5.3.0.1 Win32 Version: 5.3.0.1 CodeBase: file:///C:/Program%20Files/Red%20Gate/SQL%20Prompt%203/RedGate.SQL.Shared.DLL ---------------------------------------- RedGate.Licensing.Helper Assembly Version: 1.3.0.25 Win32 Version: 1.3.0.25 CodeBase: file:///C:/Program%20Files/Red%20Gate/SQL%20Prompt%203/RedGate.Licensing.Helper.DLL ---------------------------------------- System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- RedGate.SQLPrompt.vsmso Assembly Version: 8.0.0.0 Win32 Version: 8.0.0.0 CodeBase: file:///C:/Program%20Files/Red%20Gate/SQL%20Prompt%203/RedGate.SQLPrompt.vsmso.DLL ---------------------------------------- RedGate.SqlPrompt.Engine Assembly Version: 3.0.0.868 Win32 Version: 3.0.0.868 CodeBase: file:///C:/Program%20Files/Red%20Gate/SQL%20Prompt%203/RedGate.SqlPrompt.Engine.DLL ---------------------------------------- EnvDTE80 Assembly Version: 8.0.0.0 Win32 Version: 8.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC/EnvDTE80/8.0.0.0__b03f5f7f11d50a3a/EnvDTE80.dll ---------------------------------------- RedGate.SqlPrompt.Engine.Gatekeeper Assembly Version: 3.0.0.868 Win32 Version: 3.0.0.868 CodeBase: file:///C:/Program%20Files/Red%20Gate/SQL%20Prompt%203/RedGate.SqlPrompt.Engine.Gatekeeper.DLL ---------------------------------------- Microsoft.VisualStudio.TextManager.Interop Assembly Version: 7.1.40304.0 Win32 Version: 7.0.4054 CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.VisualStudio.TextManager.Interop/7.1.40304.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.TextManager.Interop.dll ---------------------------------------- System.Data Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll ---------------------------------------- RedGate.Shared.Utils Assembly Version: 5.3.0.1 Win32 Version: 5.3.0.1 CodeBase: file:///C:/Program%20Files/Red%20Gate/SQL%20Prompt%203/RedGate.Shared.Utils.DLL ---------------------------------------- System.Configuration Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- ObjectExplorer Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/ObjectExplorer.DLL ---------------------------------------- ConnectionDlg Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/ConnectionDlg.DLL ---------------------------------------- Microsoft.SqlServer.CustomControls Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.CustomControls/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.CustomControls.dll ---------------------------------------- SqlWorkbench.Interfaces Assembly Version: 9.0.242.0 Win32 Version: 9.00.1399.00 CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/SqlWorkbench.Interfaces.DLL ---------------------------------------- Accessibility Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll ---------------------------------------- Microsoft.SqlServer.RegSvrEnum Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.RegSvrEnum/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.RegSvrEnum.dll ---------------------------------------- SqlMgmt Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/SqlMgmt.DLL ---------------------------------------- Microsoft.VisualStudio Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 built by: RTM CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio/2.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.dll ---------------------------------------- Microsoft.VisualStudio.Shell Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.762 (SP.050727-7600) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Shell/2.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Shell.dll ---------------------------------------- Microsoft.VisualStudio.Shell.Interop.8.0 Assembly Version: 8.0.0.0 Win32 Version: 8.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.VisualStudio.Shell.Interop.8.0/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Shell.Interop.8.0.dll ---------------------------------------- System.Drawing.Design Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing.Design/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.Design.dll ---------------------------------------- Microsoft.VisualStudio.Designer.Interfaces Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.VisualStudio.Designer.Interfaces/1.0.5000.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Designer.Interfaces.dll ---------------------------------------- System.Design Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Design/2.0.0.0__b03f5f7f11d50a3a/System.Design.dll ---------------------------------------- Microsoft.VisualStudio.Design Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.762 (SP.050727-7600) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Design/2.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Design.dll ---------------------------------------- Microsoft.VisualStudio.Shell.Design Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Shell.Design/2.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Shell.Design.dll ---------------------------------------- SQLEditors Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/SQLEditors.DLL ---------------------------------------- Microsoft.NetEnterpriseServers.ExceptionMessageBox Assembly Version: 9.0.242.0 Win32 Version: 9.00.1399.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.NetEnterpriseServers.ExceptionMessageBox/9.0.242.0__89845dcd8080cc91/Microsoft.NetEnterpriseServers.ExceptionMessageBox.dll ---------------------------------------- Microsoft.SqlServer.ConnectionInfo Assembly Version: 9.0.242.0 Win32 Version: 9.00.1399.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.ConnectionInfo/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.ConnectionInfo.dll ---------------------------------------- Microsoft.SqlServer.BatchParser Assembly Version: 9.0.242.0 Win32 Version: 2005.090.2047.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_32/Microsoft.SqlServer.BatchParser/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.BatchParser.dll ---------------------------------------- Microsoft.SqlServer.GridControl Assembly Version: 9.0.242.0 Win32 Version: 9.00.1399.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.GridControl/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.GridControl.dll ---------------------------------------- System.Management Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Management/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll ---------------------------------------- System.Transactions Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll ---------------------------------------- System.EnterpriseServices Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll ---------------------------------------- Microsoft.SqlServer.SqlEnum Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.SqlEnum/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.SqlEnum.dll ---------------------------------------- Microsoft.ReportViewer.WinForms Assembly Version: 8.0.0.0 Win32 Version: 8.0.50727.762 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.ReportViewer.WinForms/8.0.0.0__b03f5f7f11d50a3a/Microsoft.ReportViewer.WinForms.dll ---------------------------------------- msvcm80 Assembly Version: 8.0.50727.762 Win32 Version: 8.00.50727.762 CodeBase: file:///C:/WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700/msvcm80.dll ---------------------------------------- Microsoft.SqlServer.SmoEnum Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.SmoEnum/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.SmoEnum.dll ---------------------------------------- Microsoft.SqlServer.Smo Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.Smo/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.Smo.dll ---------------------------------------- ObjectExplorerReplication Assembly Version: 9.0.242.0 Win32 Version: 9.00.1399.00 CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/ObjectExplorerReplication.DLL ---------------------------------------- SqlManagerUI Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/SqlManagerUi.DLL ---------------------------------------- Microsoft.AnalysisServices Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.AnalysisServices/9.0.242.0__89845dcd8080cc91/Microsoft.AnalysisServices.dll ---------------------------------------- Microsoft.SqlServer.SString Assembly Version: 9.0.242.0 Win32 Version: 9.00.1399.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.SString/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.SString.dll ---------------------------------------- Microsoft.SqlServer.DlgGrid Assembly Version: 9.0.242.0 Win32 Version: 9.00.1399.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.DlgGrid/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.DlgGrid.dll ---------------------------------------- Microsoft.SqlServer.DataStorage Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.DataStorage/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.DataStorage.dll ---------------------------------------- Microsoft.SqlServerCe.Client Assembly Version: 9.0.242.0 Win32 Version: 3.0.5207.0 CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServerCe.Client.DLL ---------------------------------------- Microsoft.AnalysisServices.Graphing Assembly Version: 9.0.242.0 Win32 Version: 9.00.2047.00 CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.AnalysisServices.Graphing.DLL ---------------------------------------- je2azucw Assembly Version: 9.0.242.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ----------------------------------------
Comments
Sorry you're having problems and thanks for letting us know. We've had several users report these problems so fixing them will be a priority for the first point release. We haven't decided on any timescales yet so I can't tell you when that's going to be, and that's mainly because we haven't decided precisely what's going to go in and what's not.
The actual problem here is a security problem in that the second instance, running as a different user, is trying to access a mutex created by the first instance running as the first user, and this is obviously blowing up. The workaround for now is to start the second instance after exiting the first instance and that way the second instance will recreate the mutex, which will have been destroyed when the first instance exited.
Hope that helps for now.
Many thanks,
Bart
Principal Consultant
bartread.com Ltd
Just to let you know this problem has been fixed in SQL Prompt 3.1. You can grab an early access release by following the instructions here:
http://www.red-gate.com/MessageBoard/vi ... php?t=4487
Hope that helps.
Thanks,
Bart
Principal Consultant
bartread.com Ltd
It works 8)
Principal Consultant
bartread.com Ltd