Using aspnet_regiis.exe tool to Encrypt and Decrypt Web.config Sections

Prerequisite (Deployment Server)

  1. Locate the Framework Folder in the IIS Server, Ex: C:\Windows\Microsoft.NET\Framework{xx}\ v4.0.xxxxx OR v2.0.xxxxx.
  2. Run the command prompt as Administrator Access,

Note. This tool (aspnet_regiis.exe) is typically found in the .NET Framework directory:

Prerequisite (Local Development Machine)

  1. Run the Developer Command Prompt for VS 20xx as Administrator Access

Commands to Execute

Note

Encrypt or Decrypt Configuration Sections

Example: aspnet_regiis -pef "appSettings" "C:\MyApp"

Example: aspnet_regiis -pdf " appSettings" "C:\MyApp"