【发布时间】:2016-02-02 10:26:42
【问题描述】:
我正在开发一个 asp.net mvc Web 应用程序。我在 web.config 中定义了一个名为 "customAppSettingsGroup" 的自定义部分组:-
<configuration>
<configSections>
<sectionGroup name="customAppSettingsGroup">
<section name="customAppSettings" type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</sectionGroup>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<customAppSettingsGroup>
<customAppSettings>
<add key="KeyOne" value="*****"/>
</customAppSettings>
</customAppSettingsGroup>
......
......
</configuration>
现在我想加密该部分,主要是为了加密 KeyOne 值。所以我写了以下命令:-
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -pe "customAppSett
ingsGroup" -app "/Scanning" -prov "DataProtectionConfigurationProvider"
但我收到以下错误:-
Microsoft (R) ASP.NET RegIIS version 4.0.30319.18408
Administration utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation. All rights reserved.
Encrypting configuration section...
The configuration section 'customAppSettingsGroup' was not found.
Failed!
所以我不确定为什么 commnad 找不到相关的部分?
谢谢
【问题讨论】:
标签: asp.net asp.net-mvc iis asp.net-mvc-5 data-protection