Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 653
Gokul Avatar asked Oct 16 '25 03:10

Gokul


1 Answers

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.

like image 63
Arys Avatar answered Oct 18 '25 22:10

Arys



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!