1

I am publishing asp.net web application using web deploy and I need to encrypt connectionsstrings and appsettings in web.config file. So added <MSDeployEnableWebConfigEncryptRule>true</MSDeployEnableWebConfigEncryptRule> in the .pubxml, then connectionstrings are encrypted but not appsettings. I need to encrypt appsettings as well. Can we encrypt appsettings by making some changes in .pubxml or Do we need to do it manually using aspnet_regiis.exe?

vineel
  • 3,483
  • 2
  • 29
  • 33
  • Possible duplicate of http://stackoverflow.com/questions/54200/encrypting-appsettings-in-web-config – Daniel James Bryars Sep 30 '15 at 16:29
  • @DanielJamesBryars: the link you referred explains about how to encrypt and decrypt using ASP.NET IIS Registration Tool (Aspnet_regiis.exe). But I am talking about encrypting automatically when publishing using web deploy. – vineel Sep 30 '15 at 16:43

1 Answers1

0

webdeploy can only encrypt connection string. If you want to encrypt appsetting or other sections, you can try using aspnet_regiis command line.

aspnet_regiis -pe "ElementName" -app "/SampleApplication"

Ref: (http://forums.iis.net/t/1223409.aspx?Encrypting+any+section+of+Web+Config)

vineel
  • 3,483
  • 2
  • 29
  • 33