title: asp.net MSDeployEnableWebConfigEncryptRule fail to encrypt web.config
body: <p>I have added <code>&lt;MSDeployEnableWebConfigEncryptRule&gt;true&lt;/MSDeployEnableWebConfigEncryptRule&gt;</code> to .pubxml file in order to encrypt web config file. However, when publishing, i got the following error. I do not know whether there is extra setting needed in the web.config file other than inserting <code>&lt;MSDeployEnableWebConfigEncryptRule&gt;true&lt;/MSDeployEnableWebConfigEncryptRule&gt;</code> in .pubxml</p>
  
  <p>Error:
  Web deployment task failed.(Fail to encrypt destination web.config. Learn more at: <a href="http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FAILED_TO_ENCRYPT_WEB_CONFIG" rel="nofollow">http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FAILED_TO_ENCRYPT_WEB_CONFIG</a>.)   </p>
  
  <p>Note: #ERROR_FAILED_TO_ENCRYPT_WEB_CONFIG does not appears anywhere on the given link.</p>
  
  <p>How could i resolve this error? (note: i do not wish to pre-encrypt the web.config file locally before publishing it)</p>