Ich stoße auf ein Problem, das ich zuvor hatte; kann meine Referenz nicht finden, wie man es löst.App.config Verbindungszeichenfolge Schutzfehler
Hier ist das Problem. Wir verschlüsseln den Verbindungszeichenabschnitt in der app.config für unseren Client-Anwendung unter Verwendung von Code unter:
config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
If config.ConnectionStrings.SectionInformation.IsProtected = False Then
config.ConnectionStrings.SectionInformation.ProtectSection(Nothing)
' We must save the changes to the configuration file.'
config.Save(ConfigurationSaveMode.Modified, True)
End If
Das Problem ist, dass wir einen Verkäufer verlassen hatten. Der alte Laptop geht zu einem neuen Verkäufer und unter dem Login des neuen Benutzers, wenn er dies versucht, erhalten wir einen Fehler. Der Fehler lautet:
Unhandled Exception: System.Configuration.ConfigurationErrorsException:
An error occurred executing the configuration section handler for connectionStrings. ---> System.Configuration.ConfigurationErrorsException: Failed to encrypt the section 'connectionStrings' using provider 'RsaProtectedConfigurationProvider'.
Error message from the provider: Object already exists.
---> System.Security.Cryptography.CryptographicException: Object already exists
Wenn Sie auf Vista oder höher sind, stellen Sie sicher, dass Sie als Administrator ausgeführt werden. –