I crypté la AppSettings partie de mon web.config, testé sur ma machine et cela a fonctionné, mais quand j'uploadé de l'utiliser en ligne, il m'a donné une erreur:erreur après Encryptingweb.config
Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Failed to decrypt using provider 'DataProtectionConfigurationProvider'. Error message from the provider: Key not valid for use in specified state. (Exception from HRESULT: 0x8009000B)
Line 24: <appSettings configProtectionProvider="DataProtectionConfigurationProvider">
Line 25: <EncryptedData>
J'utilisé les sous pour chiffrer:
Private Sub ProtectSection(ByVal sectionName As String, ByVal provider As String)
Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)
Dim section As ConfigurationSection = config.GetSection(sectionName)
If section IsNot Nothing AndAlso Not section.SectionInformation.IsProtected Then
section.SectionInformation.ProtectSection(provider)
config.Save()
End If
End Sub
Vous voulez dire que je dois le chiffrez en ligne? – Maen
Oui, la méthode ProtectSection() que vous utilisez le fera la première fois que l'application sera touchée. – Jeremy
L'a fait, problème résolu ... merci beaucoup ... – Maen