We help IT Professionals succeed at work.

Microsoft SQL Server Management Studio

bizantd
bizantd used Ask the Experts™
on


Attempted to read or write protected memory. This is often an indication that other memory is corrupt. (Microsoft.SqlServer.Smo)

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Guy Hengel [angelIII / a3]Billing Engineer
Most Valuable Expert 2014
Top Expert 2009

Commented:
first reaction would be to ensure that you apply the same patches to the GUI installation than to the backend server ...
in case this is the same box, please show at least some relevant code ...
bizantdEngineer

Author

Commented:
This message pops up when I am opening sqlserver 2005 management studio.However I can click on continue and it lets me in.

This what I get
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.Reflection.Assembly.GetFullName()
   at System.Reflection.Assembly.get_FullName()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.StaticHelpers.GetFullAssemblyName(String assemblyName)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsObjectBuilder.CreateType()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsObjectBuilder.get_Type()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsObjectBuilder.Build()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.<SetStaticProperties>b__0(IServiceContainer container, Type serviceType)
   at System.ComponentModel.Design.ServiceContainer.GetService(Type serviceType)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.GetService(Type serviceType)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.GetService(Type serviceType)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NodeContext.GetService(Type serviceType)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NotificationContext.GetService(Type serviceType)
   at Microsoft.SqlServer.Management.UI.VSIntegration.AppIDPackage.ReportSource.GetFilters(INodeInformation node)
   at Microsoft.SqlServer.Management.UI.VSIntegration.AppIDPackage.RightPaneControl.SetReportSource(INodeInformation[] nodes)
   at Microsoft.SqlServer.Management.UI.VSIntegration.AppIDPackage.RightPaneToolWindow.OnReportSourceChanged(Object sender, NodesChangedEventArgs args)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.OnSelectionChanged(NodesChangedEventArgs args)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.SelectedNodeChanged(Object sender, TreeViewEventArgs args)
   at System.Windows.Forms.TreeViewEventHandler.Invoke(Object sender, TreeViewEventArgs e)
   at System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)
   at System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv)
   at System.Windows.Forms.TreeView.WmNotify(Message& m)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.LazyTreeView.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.4035.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.794 (QFE.050727-7900)
    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.4035.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.10.6070
    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.10.6070
    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
----------------------------------------
SqlWorkbench.Interfaces
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.00
    CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/SqlWorkbench.Interfaces.DLL
----------------------------------------
Microsoft.DataWarehouse.SQM
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.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
----------------------------------------
ObjectExplorer
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.00
    CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/ObjectExplorer.DLL
----------------------------------------
SqlMgmt
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.00
    CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/SqlMgmt.DLL
----------------------------------------
ConnectionDlg
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.00
    CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/ConnectionDlg.DLL
----------------------------------------
Microsoft.VisualStudio
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1826 built by: QFE
    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.1826 (QFE.050727-1800)
    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.1826 (QFE.050727-1800)
    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
----------------------------------------
Microsoft.SqlServer.RegSvrEnum
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.00
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.RegSvrEnum/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.RegSvrEnum.dll
----------------------------------------
Microsoft.SqlServer.Management.Reports
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.00
    CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Management.Reports.DLL
----------------------------------------
EnvDTE
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.1826 (QFE.050727-1800)
    CodeBase: file:///C:/WINDOWS/assembly/GAC/EnvDTE/8.0.0.0__b03f5f7f11d50a3a/EnvDTE.dll
----------------------------------------
Microsoft.NetEnterpriseServers.ExceptionMessageBox
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.00
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.NetEnterpriseServers.ExceptionMessageBox/9.0.242.0__89845dcd8080cc91/Microsoft.NetEnterpriseServers.ExceptionMessageBox.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
----------------------------------------
Microsoft.SqlServer.CustomControls
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.00
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.CustomControls/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.CustomControls.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.ConnectionInfo
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.00
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.ConnectionInfo/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.ConnectionInfo.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
----------------------------------------
Microsoft.SqlServer.SmoEnum
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.00
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.SmoEnum/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.SmoEnum.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
----------------------------------------
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.Smo
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.00
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.Smo/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.Smo.dll
----------------------------------------
Microsoft.SqlServer.SqlEnum
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.4035.00
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.SqlEnum/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.SqlEnum.dll
----------------------------------------
Microsoft.SqlServer.BatchParser
    Assembly Version: 9.0.242.0
    Win32 Version: 2005.090.4035.00
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/Microsoft.SqlServer.BatchParser/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.BatchParser.dll
----------------------------------------
msvcm80
    Assembly Version: 8.0.50727.163
    Win32 Version: 8.00.50727.163
    CodeBase: file:///C:/WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.163_x-ww_681E29FB/msvcm80.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.Web
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

Open in new window

Vitor MontalvãoIT Engineer
Distinguished Expert 2017

Commented:
Check this article: http://support.microsoft.com/kb/926421/en-us

Good luck
Aaron ShiloChief Database Architect

Commented:
doenload and install hotfix
; http://support.microsoft.com/kb/926421
bizantdEngineer

Author

Commented:
no luck guys now I am receiving following error.
Also like to add that my visual studio 2005 express edition is also crashing without any errors.

Attempted to read or write protected memory. This is often an indication that other memory is corrupt. (mscorlib)

------------------------------
Program Location:

   at System.Reflection.Module.GetTypeInternal(String className, Boolean ignoreCase, Boolean throwOnError)
   at System.Reflection.Module.GetType(String className, Boolean throwOnError, Boolean ignoreCase)
   at System.Reflection.Module.GetType(String className)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsObjectBuilder.CreateType()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsObjectBuilder.get_Type()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsObjectBuilder.Build()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.AddProperty(String name, Object value)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsObjectBuilder.Build()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.ConstructChildren()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.SetStaticProperties(NavigableItem node)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildStaticItem(IList nodes, INodeInformation source, INavigableItem sourceItem)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.Build(INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.GetChildren()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ExplorerHierarchyNode.BuildChildren()
VENKAT KOKULLASQL Server DBA

Commented:
"Reset Windows Layout", the try
bizantdEngineer

Author

Commented:
Sorry I don't get it.What do you mean by that and how to do it.
Thanks
Engineer
Commented:
Dear All

I have resolved this issue my self and solution was to clean registry with registry cleaning tool and it fixed the problem.
Hurray.
bizantdEngineer

Author

Commented:
I solved it my self.