I used aspnet_regiis to successfully encrypt the web.config file, which works on a Windows 2003 server. However, it does not work on IIS 7 on a Windows 7/2008 server.
When I try to run the followng command on a 64-bit Windows 2008 server, it always displays the aspnet_regiis settings help. The same thing happens in Windows 7.
C: \ Windows \ Microsoft.Net \ Framework64 \ v2.0.50727 \ aspnet_regiis -pe "appSettings" -app "/ ConnectionTest" -site 4
If I open a Visual Studio 2008 command in Windows 7 and run the following command, I got it. I am using the site id from iis manager.
aspnet_regiis -pe "appSettings" -app "/ ConnectionTest" -site 4 Failed to resolve site ID for "4" Error!
source share