How to properly encrypt my Web.config using aspnet_regiis.exe?

筅森魡賤 提交于 2019-12-14 03:42:34

问题


Based off of this page, I did the following:

  1. Went to "All Programs" -> "Microsoft Visual Studio 2012" -> "Visual Studio Tools" -> "Open VS2012 x64 Native Tools Command Prompt".
  2. Typed: aspnet_regiis -pe "connectionStrings" -app "C:/FirstName-Projects/ProjName-TEST/SolutionName/Web.config" -prov "DataProtectionConfigurationProvider"
  3. Received: "The value used in the -app parameter must begin with a forward slash."

I'm guessing I did something wrong in my attempt to call the Web.config file down through my C: directory?

I then read through to the part of Step 3.4 and also tried the -pef by using aspnet_regiis -pef "connectionStrings" C:FirstName-Projects/ProjName-TEST prov "DataProtectionConfigurationProvider" which resulted in a full listing of all registration options I can provide.

Can anyone provide me some input on what to use based on the Web.config file being in C:/FirstName-Projects/ProjName-TEST/SolutionName/Web.config?


回答1:


Please use the below syntax for encrypting the physical file.

aspnet_regiis -pef "connectionStrings" "C:/FirstName-Projects/ProjName-TEST/SolutionName"

Ensure you run the command editor as administrator

Note: The app means the IIS virtual path in command you mentioned



来源:https://stackoverflow.com/questions/19730114/how-to-properly-encrypt-my-web-config-using-aspnet-regiis-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!