Gokul
Gokul

Reputation: 1371

Encrypt App.config using aspnet_regiis -pef

I use "%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pef "connectionStrings" "C:\documents and settings\bob\projects\myproject" to encrypt the Web.config files. The same command does not work for App.config. How do I encrypt App.config files?

Upvotes: 4

Views: 711

Answers (1)

Arys
Arys

Reputation: 487

Maybe a bit of necromancy, but i just stumbled on the same problem.

So the answer is to rename app.config to web.config
Perform encryption using the command you already use
Rename back web.config to app.config

Link to explanation and examples
Extracted from the link:

So this is a little strange and the reason is that the tool only works with web.config files, however by renaming, then processing our app.config file we can get the desired result.

Upvotes: 3

Related Questions