none
Bad Data failed to decrypt using provider 'CustomProvider' RRS feed

  • Question

  • The console application was working fine till I decided to encrypt the App.config file.
    I manually encryped the configuration file.

    Now when I run my application I get an exception:
    Complaint references a line in the config file:
    <EncryptedData Type=http://www.w3.org/20001/04/exlenc#Element
    xmlns="http://www.w3.org/2001/04/xmlenc#>

    Any ideas on how to resolve this issue?


    Chuck
    Monday, August 1, 2011 7:33 PM

All replies

  • Hi Chuck,

    Could you please kindly elaborate how did you manually encryped the configuration file?

    Thanks!

    Best regards,

     


    Min Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, August 5, 2011 9:20 AM
    Moderator
  • I added the <configProtectedData> block tag to my asp config file just below the ending </configSections> tag.

    I renamed my app.config file to Web.config.

    I then ran the aspnet_regiis in a command window to encode the Web.config file.

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pef "connectionStrings" %1 -prov "CustomProvider"

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pef "appSettings" %1 -prov "CustomProvider"
    (where %1 is the path to the Web.config file)

    I renamed the encoded Web.config file to <application.exe.config>.

    Regards,

    Chuck


    Chuck
    Monday, August 22, 2011 1:13 PM