Alex Rivera | Logout

SQL Server 2008 R2 - .NET Framework unhandled exception

Asked 2011-04-21T13:34:28.937
9

I have installed SQL Server 2008 R2 on a new PC. Everything was working fine until I started exporting registered servers from the SQL Server 2008 R2 management studio which exist on my old PC. When I imported one of the registered servers to my new installation I got and error "Key not valid for use in specified state".

Now everytime I try to open registered servers on the new installation I get a .NET framework Unhandled Exception with the same message. The registered server area is completely empty. There is no way of adding any registered servers now. I have tried reinstalling SQL but the error remains. It is obviously related to the import process. Maybe something got corrupted. Does anyone know how to fix it?

Edit:Details from exception dialog

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.Registere
Edit
Report

1 Answer

5

The RegSrvr.xml file was the problem for me too. But rather than delete the whole file, I just edited it to delete out the encrypted password strings. After that, Management Studio opened fine with all the imported servers present.

answered 2011-06-25T05:21:02.043

Your Answer