I used aspnet_regiis successfully encrypted web.config file which running on windows 2003 server. However it doesn't work in IIS 7 on Windows 7/2008 server.
When I try to run the followng command in 64bit Windows 2008 server, it always shows the aspnet_regiis options help. The same thing is in windows 7 OS.
C:\Windows\Microsoft.Net\Framework64\v2.0.50727\aspnet_regiis –pe “appSettings” –app “/ConnectionTest” –site 4
If I open Visual Studio 2008 command in windows 7 and run the following command, I got those. I use the site Id from iis manager.
aspnet_regiis –pe “appSettings” –app “/ConnectionTest” –site 4 Failed to resolve the site ID for '4' Failed!
Encrypting a Web Configuration Section To encrypt configuration file contents, use the Aspnet_regiis.exe tool with the –pe option and the name of the configuration element to be encrypted. Use the –app option to identify the application for which the Web.
In order to encrypt the ConnectionString section in the Web. Config file, we will need to use the aspnet_regiis.exe tool. Action – It notifies the action to be performed. In order to perform Encryption, the parameter value is -pef.
Have you tried running a command window "As Administrator"? This just caught me out for a moment too but running as admin fixed it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With