I am trying to publish on an FTP server I encrypt my web .config file using this code I am:
var exeConfigName = @ "D: \ Repo \ mypp \ WebApplication1 \ Web.config"; Configuration Config = Configuration Manager Openexe configuration (exeConfigName); App section = config.GetSection ("appSettings") as AppSettingsSection; ConnectionStringsSection Section 2 = config.GetSection ("connectionStrings") ConnectionStringsSection ;; Var section 3 = config.GetSection ("system.net/mailSettings/smtp") ConfigurationSection; If (section! = Null & amp; section session information. Protected) {// Remove encryption section.SectionInformation.UnprotectSection (); } Else {//} Encrypt section if (section! = Null) section Session information. Department of Defense ("Data Processing Processing Provider"); } If (Section 2! = Null & amp; section section 2. op info protected) {// Remove encryption section2.SectionInformation.UnprotectSection (); } Else {// encrypt the section if (section 2! = Null) section 2. Communication information. Department of Defense ("Data Processing Processing Provider"); } If (section 3! = Null & amp; section 3. op notification. IP protected) {// Remove encryption section3.SectionInformation.UnprotectSection (); } Encrypt Else {// section if (section 3! = Null) section 3. Location information. Protection signal ("data processing configuration prevail"); } // Save the current configuration. Config.Save ();
I get two web configurations i. Web. Configure (normal) and Web Config keyring (encrypted). When I only publish the web Config is sent so that I manually added the encrypted classes to the Web.config on the server. But I get the following error:
The error message from the provider failed to decrypt the provider to use 'DataProtectionConfigurationProvider': The key to use in the specified state is not valid.
& lt; / Runtime & gt; & Lt; App Settings Configuration Providers = "DateText Processing Providers" & gt; & Lt; Encrypted Data & gt; // error is written in red; Cefdata & gt; & Lt; CipherValue & gt; AQAAANCMnd8BFdERjHoAwE / Cl + sBAAAAKvzpAGMd9EWXylxQjNCcdAQAAAACAAAAAAADZgAAwAAAABAAAABPSw54k9XlD + Mv / LWO9npqAAAAAASAAACgAAAAEAAAALpLRoKXjtupmwjCJCBfEtwgAAAAO3J95kdVtev2Cvc1Chtkajg8ZNamBU7zV9EXNy4VQgoUAAAAVNrkN3oVQVy12XSbxdZVVilA / r0 = & lt; / CipherValue & gt;
How can I fix this? Also, there is not a release folder in my bin folder (odd) This is my first publication and encryption thanks to
No comments:
Post a Comment