Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <!--
- Use this as a template for when you need to update the encrypted connection strings in
- `ConnectinStrings.config`
- To encrypt the `connectionStrings` section:
- 1. Make a copy of this file and rename it to `Web.config` temporary.
- (`aspnet_regiis.exe` only succeeds if you name it that.)
- 2. Open a command prompt in the current directory.
- 3. Run `C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" "."`
- 4. The `connectionStrings` section has now been encrypted in place.
- 5. Rename the temporary `Web.config` file to `ConnectionStrings.config`
- 6. In the newly created `ConnectionStrings.config`, make the `connectionStrings` section as the
- root element by removing `configuration` as the root element.
- You have to do this since `ConnectionStrings.config` is loaded into the application's root
- `Web.config` using `configSource`.
- To decrypt the `connectionStrings` section in place:
- 1. Rename `ConnectionStrings` to `Web.config`
- (because `aspnet_regiis.exe` only succeeds if you name it that)
- 2. Add a `<configuration>` tag and make it the root element enclosing `<connectionStrings>
- (again for `aspnet_regiis.exe`)
- 3. Open a command prompt in the current directory.
- 4. Run `C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pdf "connectionStrings" "."`
- 5. The connection strings are now unencrypted.
- -->
- <configuration>
- <connectionStrings>
- <add name="ConnectionStringName" connectionString="Foo=bar;" />
- </connectionStrings>
- </configuration>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement