我在新PC上安裝了SQL Server 2008 R2。一切工作正常,直到我開始從舊PC上存在的SQL Server 2008 R2管理工作室導出已註冊的服務器。當我將一臺已註冊的服務器導入到我的新安裝中時,我收到了錯誤「密鑰無法在指定狀態中使用」。SQL Server 2008 R2 - .NET Framework未處理的異常
現在,每次我嘗試在新安裝上打開註冊的服務器時,我都會得到一個.NET框架未處理的異常,並顯示相同的消息。註冊的服務器區域是完全空的。現在無法添加任何已註冊的服務器。我試過重新安裝SQL,但錯誤依然存在。這顯然與進口過程有關。也許有些東西被損壞了。有誰知道如何修理它?
編輯:從異常詳細信息對話框
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.
at System.Security.Cryptography.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope)
at Microsoft.SqlServer.Management.RegisteredServers.RegisteredServer.ProtectData(String input, Boolean encrypt)
at Microsoft.SqlServer.Management.RegisteredServers.RegisteredServer.get_SecureConnectionString()
at Microsoft.SqlServer.Management.RegisteredServers.RegisteredServer.get_ConnectionString()
at Microsoft.SqlServer.Management.RegisteredServers.RegisteredServer.get_ServerName()
at Microsoft.SqlServer.Management.RegisteredServers.RegisteredServerTree.AddRegisteredServerNode(RegisteredServer regSrv, TreeNodeCollection nodes)
at Microsoft.SqlServer.Management.RegisteredServers.RegisteredServerTree.AddServerGroupToNodeCollection(ServerGroup group, TreeNodeCollection nodes, Boolean createRecursively)
at Microsoft.SqlServer.Management.RegisteredServers.RegisteredServerTree.AddServerGroupToNodeCollection(ServerGroup group, TreeNodeCollection nodes, Boolean createRecursively)
at Microsoft.SqlServer.Management.RegisteredServers.RegisteredServerTree.Initialize(ServerGroup localServerGroup, ServerType serverType, IServerType connDlgServerType, AddCentralManagementServerDelegate onAddCentralManagementServer, AddNewCentralManagementServerDelegate onAddNewCentralManagementServer, DeleteCentralManagementServerDelegate onDeleteCentralManagementServer, GetServiceProviderDelegate onGetService)
at Microsoft.SqlServer.Management.RegisteredServers.RegisteredServerControl.RegisteredServerControl_Load(Object sender, EventArgs e)
at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
at System.Windows.Forms.UserControl.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.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)
http://stackoverflow.com/a/6476025/2990378 - 此解決方案爲我工作 – MHS 2013-11-14 03:14:41