Encrypt connection string in app.config

app-config, c#, sql-server-2008

Solution

Have a look at This Article it has some very useful examples. You're basically looking for `System.Configuration.SectionInformation.ProtectSection` to help you out here.

Also have a peek at Implementing Protected Configuration

Problem

I am having trouble encrypting a connection string in app.config. I have code that will protect the connectionStrings section of app.config, but the password is still displayed in plain text. I need to encrypt the connection string in so it is not in plain text when deployed. I see similiar questions on SO for web.config, but not app.config.

Original source