"The section is marked as being protected, but it does not have the correct format. It should contain only the <EncryptedData> child node."
It turns out that a new key that was auto generated in this particular project dealing with WCF was injected between the <EncryptedData> nodes (as shown below).
Once I removed the new key and attempted the decryption, everything worked properly! So if you come across this error, see if any new keys have been added (or any other elements for that matter) between the <EncryptedData> nodes because it will cause this error.
</CipherData>
<add key="ClientSettingsProvider.ServiceUri" value="" />
</EncryptedData>
Saved me a lot of time. Thanks!
ReplyDeleteAwesome tip, resolved my issue perfectly
ReplyDeleteI am getting this error "The section is marked as being protected, but it does not have the correct format. It should contain only the child node." While Encrypting. Can I have the solution for this
ReplyDeleteThanks Allen that was it
ReplyDeletethank you so much...!!! just what i was looking for..
ReplyDeleteworked great, thanks
ReplyDeleteI had the same problem. Same line added in config file.
ReplyDelete