Ben Steele
Ben Steele

Reputation: 414

App.config decryption fails after a reboot

We have a WPF application where we encrypt our connection strings after a first read:

Configuration config = OpenConfiguration(configFileName);

ConfigurationSection configSection = config.GetSection(sectionName);

if (configSection == null)
    return false;

if (!configSection.SectionInformation.IsProtected)
{
    if (!configSection.SectionInformation.IsLocked)
    {
        configSection.SectionInformation.ProtectSection("DataProtectionConfigurationProvider");
        config.Save();
    }
}

We have this on hundreds of machines, so far everything has worked great. After the first run, the plain text connection strings are encrypted. The decryption should just work automatically. However, we have one machine which is unable to decrypt this information after Windows has rebooted.

My understanding is that the "DataProtectionConfigurationProvider" uses something system specific as its encryption key. Has anyone got any ideas that may help me track down the problem? I am a bit stumped as to why it is this one machine that isn't working.

Thanks in advance

Upvotes: 1

Views: 57

Answers (1)

Ben Steele
Ben Steele

Reputation: 414

Just to close off this issue, the problem is now solved.

There was an issue with the deployment to this particular machine, the MD5 checksum of the files was on the machine in question were different. A Manual install of the files has cleared this issue up.

Upvotes: 1

Related Questions