Symptoms
Consider the following scenario:
-
You uninstall an existing instance of Microsoft SQL Server 2008 R2 Express with Advanced Services.
-
You install an instance of Microsoft SQL Server 2012 Express with Advanced Services.
In this scenario, if you try to open a new query window in Microsoft SQL Server Management Studio, you receive the following error message:
Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))
Additionally, when you click Details, you receive the following error message:
Program Location:
at EnvDTE._DTE.get_Properties(String Category, String Page)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.EditorFactorySql.CreateEditorInstance(IServiceProvider serviceProvider, Boolean storeActiveConnIfNeeded, String moniker)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.EditorFactoryBase.Microsoft.VisualStudio.Shell.Interop.IVsEditorFactory.CreateEditorInstance(UInt32 createFlags, String moniker, String physicalView, IVsHierarchy hierarchy, UInt32 itemId, IntPtr existingDocData, IntPtr& docViewIntPtr, IntPtr& docDataIntPtr, String& caption, Guid& cmdUIGuid, Int32& result)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.CreateNewScript(String strFullPathToScript, IVsProject projectToAddScriptTo, UIConnectionGroupInfo connectionInfoList, IDbConnection liveCon, String rootName)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.CreateNewScript(String strFullPathToScript, IVsExternalFilesManager extFileMgr, UIConnectionGroupInfo connectionInfoList, IDbConnection liveCon, String rootName)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.CreateNewScript(String strFullPathToScript, UIConnectionGroupInfo connectionInfoList, IDbConnection liveCon, String fileRoot)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.CreateNewScript(String strFullPathToScript, UIConnectionInfo ci, IDbConnection liveCon)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NewQueryMenuHandler.Invoke()
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsMenuItemBase.MenuInvokedHandler(Object sender, EventArgs args)
Workaround
To work around this problem, follow these steps:
-
Click Start, click Run, type regedit in the Open box, and then click OK.
-
In Registry Editor, locate the following key:
HKEY_CLASSES_ROOT\TypeLib
-
If the subkey {91A74EB0-EFA0-482B-B43C-35CFC74B275F} exists, delete it.
-
Exit Registry Editor.
-
Click Start, click Run, type cmd in the Open box, and then click OK.
-
Type the following into the Command Prompt window, and then press Enter:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\dteproperties.tlb"
-
You should receive a message about the registration being successful.
-
Restart SQL Server Management Studio.
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
More Information
For more information, see Microsoft Connect Feedback ID: 761226.