encrypting web.config failed error

后端 未结 9 1129
囚心锁ツ
囚心锁ツ 2021-02-18 13:18

I know that ppl have already asked questions regarding encrypting web.config.

im also trying to encrypt my test config file, but im getting this error.

aspnet_re

9条回答
  •  礼貌的吻别
    2021-02-18 13:54

    I know this is old, but I've just had the same issue and none of the other answers got the problem.

    You're not supposed to put the filename in the path, and the file MUST be called web.config. So for your example, if your web.config file is actually in C:\ you would put:

    aspnet_regiis -pef "connectionStrings" "C:\"
    

    and your file MUST be called web.config as the tool will only look for that file.

    For those people whose file isn't in C:\ you'll need to put the full path to the file (root of the site). You'll also need to cd into the directory containing the aspnet_regiis.exe file or put the full file path for the tool as well:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -pef "ConnectionStrings" "C:\Ghron\Projects\Company\trunk\project1\project1"
    

    Also, some of the other answers are valid points - the parameters are case sensitive, so your paths and section names must be in the right case. I wasted about 20 minutes using "ConnectionStrings" instead of "connectionStrings" (lower case c).

提交回复
热议问题