Error Key not valid for use in specified state when opening Microsoft SQL Server Management Studio

An error occurs: Already has a registered server with name when adding a server to the list of registered servers in Microsoft SQL Server Management Studio

This error may occur when importing saved settings from previous versions of Microsoft SQL Server Management Studio, usually because the stored security information is encrypted using a different algorithm than the current one.

When this error occurs, improperly configured servers disappear from the Registered Servers window, making it difficult to eliminate the error.

The configuration for these servers is stored in a file called RegSrvr16.xml or RevSrvr.xml, usually in one of the following locations:

c:\users\[username]\AppData\Roaming\Microsoft\Microsoft SQL Server\[version]
c:\users\[username]\AppData\Roaming\Microsoft\SQL Server Management Studio
c:\users\[username]\AppData\Roaming\Microsoft\SQL Server Management Studio\[version] 

Where: [username] is the Windows username and [version] is the version of SQL Server Management Studio.

This file is editable with a plain text editor, such as Notepad, Notepad++ or Visual Studio Code. You simply need to remove the incorrect references to registered servers that do not appear in the corresponding window's list.

Credits