Asp.net 找不到aspnet_regis节

Asp.net 找不到aspnet_regis节,asp.net,iis,Asp.net,Iis,我正在尝试加密我的web.config aspnet_regiis一直告诉我:未找到配置部分“applicationSettings” 我访问了这个网站: 我的web.config如下所示: <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="x" type="x" /> <sectio

我正在尝试加密我的web.config

aspnet_regiis一直告诉我:未找到配置部分“applicationSettings”

我访问了这个网站:

我的web.config如下所示:

<?xml version="1.0" encoding="utf-8"?>
<configuration>

    <configSections>
        <section name="x" type="x" />
     <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <section name="x.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </sectionGroup>
 </configSections>

    <configProtectedData>
      <providers>
         <add name="MyProvider"
              type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0. 0.0,
                    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
                    processorArchitecture=MSIL"
              keyContainerName="MyKeys" 
              useMachineContainer="true" />
      </providers>
   </configProtectedData>

... 

  <applicationSettings>
    <x.Properties.Settings>
      <setting name="PollingInterval" serializeAs="String">
        <value>10000</value>
      </setting>
    </x.Properties.Settings>
  </applicationSettings>
</configuration>

... 
10000
我使用命令:aspnet_regis-pe“applicationSettings”-app“/MyApplication”-prov“MyProvider”

当我将configProtectedData部分移动到configSections之上时,它会加密应用程序设置,但会删除configSections部分,无论如何,IIS告诉我configSections必须是第一个元素。我不确定我做错了什么

在配置部分中列出应用程序设置是否有问题


谢谢您的帮助。

好的,找到了解决方案

如“configSections”中所述,“applicationSettings”是一个SectionGroup,而不是Section。aspnet_regiis只能加密节


所以我不得不更深入一步:aspnet_regis-pe“applicationSettings/x.Properties.Settings”-app“/MyApplication”-prov“MyProvider”

我也遇到了同样的问题。我将configProtectedData放在web.config的顶部,当我加密其他部分时,它会不断删除我的configSections。在看到您的帖子后,我将configProtectedData部分向下移动,现在我的configSections保持不变。谢谢