我正在尝试加密web.config文件的ConnectioString。我以管理员身份运行cmd并将以下commnad作为
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pef ProvantisDataConnection" "C:\inetpub\wwwroot\PSOC"
Encrypting configuration section...
The configuration section 'ProvantisDataConnection' was not found.
Failed!
我在web.config中的C:\inetpub\wwwroot\PSOC
和<connectionStrings>
部分内有web.config文件,如下所示
<connectionStrings>
<add name="ProvantisDataConnection" connectionString="Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.00.00.0001)(PORT= 4321))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = ABC))));User Id=ABCD ;Password=ABCDD;pooling=true;min pool size=5;Max Pool Size=60" providerName="Oracle.DataAccess.Client" />
</connectionStrings>
但它仍然会失败。
答案 0 :(得分:4)
运行aspnet_regiis时,需要指明要加密的节点的名称。您无法通过属性值选择要加密的内容。基本上,改变
aspnet_regiis -pef ProvantisDataConnection
到
aspnet_regiis -pef connectionStrings