Sunday 19 July 2015

SSMS error Attempted to read or write protected memory

SQL server management studio 2012 crashed after opening top 200 raw to edit. And it says

Error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. (Microsoft.VisualStudio.OLE.Interop)

Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.MarshalingWindowFrame.Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame.Show()
...

And then after is says "SQL server management studio restarting.."

I was stuck with the problem but i found something interesting on https://connect.microsoft.com/SQLServer/feedback/details/730985/smss-crashes-when-creating-new-database-diagram#

I took the following files from a machine that had SSMS 2008 and Visual Studio 2010 installed and never had any RC releases of any software ever installed on it.

When I right-clicked my DLLs and went to the Details tab, it previously showed Visual Studio 2012 which means the RC released I installed left my system all junked up.

Step 1:
Replaced the following file: C:\Program Files (x86)\Common Files\microsoft shared\Visual Database Tools\dsref80.dll

Step 2:
Replaced all files in the following folder: C:\Program Files (x86)\Common Files\microsoft shared\MSDesigners8\

and i thought i will work for me. But :(
Then i saw, there was something wrong with the version compatibility. Finally
Solution: I upgrade my SQL server 2012 management tools to SQL server 2014 management tools and it worked for me.