Saturday, 23 May 2009

Management Studio Error - .Net Framework

Following an epic HDD fail (dead drive) in my work desktop pc, I reinstalled SQL 2008 on my new OS (support gave me new drive and image of company OS).

On attempting to open Management Studio (after successful SQL install), I was greeted with this...

" Unhandled exception has occurred in a component in your application. If you
click Continue, the application will ignore this error and attempt to
continue. Key not valid for use in specified state. "

Clicking 'Details' was not much more help...

" ************** 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)

..... "

When Management Studio opened, 'Registered Servers' was empty. I mean totally empty.
Database engine icon was missing and i could not even add servers >

Basically, my roaming profile had bought with it an old Management Studio config file that could not be opened.
To solve this,
  1. Navigate to C:\Documents and Settings\ [username] \Application Data\Microsoft\Microsoft SQL Server\100\Tools\Shell .

  2. Rename the old RegSrvr.xml to something else e.g. RegSrvr.bak

  3. Start Management Studio again (it will recreate the file and you'll be able to add your servers again)

Link :

No comments: