【发布时间】:2015-01-21 02:15:02
【问题描述】:
我想加密 common.config,而不是 Web.config 文件。 Common.config 与 web.config 位于不同的位置。 web.config 文件连接到 common.config。
web.config:
<appSettings file="C:\Users\ja\Documents\common.config">
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
common.config:
<appSettings>
<add key="myKey" value="This is the Value"/>
</appSettings>`
这适用于 web.config 文件:
aspnet_regiis.exe -pef appSettings c:\Users\ja\Desktop\test\webapp\webapp -prov "RsaRpotectedConfigurationProvider"
但是当我尝试加密 common.config 文件时:
aspnet_regiis.exe -pef appSettings c:\Users\ja\Document\ -prov "RsaRpotectedConfigurationProvider"
我得到这个错误:
The configuration for physical path 'c:\Users\ja\Document\' cannot be opened
【问题讨论】:
标签: asp.net web-config