如何解决在ASP.NET环境中无法找到aspnet_regiis命令的问题?
- 内容介绍
- 文章标签
- 相关推荐
本文共计370个文字,预计阅读时间需要2分钟。
我正在尝试加密我的web.config文件。使用aspnet_regiis工具时,它直接告诉我找不到配置部分applicationSettings。我注意到这个网站:Walkthrough: Creating and Exporting an RSA Key Container,我的web.config看起来像这样:
我正在尝试加密我的web.config.aspnet_regiis一直告诉我:找不到配置部分’applicationSettings’.
我关注这个网站:Walkthrough: Creating and Exporting an RSA Key Container
我的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>
我使用命令:aspnet_regiis -pe“applicationSettings”-app“/ MyApplication”-prov“MyProvider”
当我在configSections上面移动Section configProtectedData时,它会加密applicationSettings,但是删除了configSections-Section,无论如何,IIS告诉我configSections需要是第一个元素.我不确定我做错了什么.
这是一个问题,applicationSettings是否在configSections中列出?
谢谢您的帮助.
如“configSections”中所述,“applicationSettings”是SectionGroup,而不是Section. aspnet_regiis只能加密Sections.
所以我不得不深入一点:aspnet_regiis -pe“applicationSettings / x.Properties.Settings”-app“/ MyApplication”-prov“MyProvider”
本文共计370个文字,预计阅读时间需要2分钟。
我正在尝试加密我的web.config文件。使用aspnet_regiis工具时,它直接告诉我找不到配置部分applicationSettings。我注意到这个网站:Walkthrough: Creating and Exporting an RSA Key Container,我的web.config看起来像这样:
我正在尝试加密我的web.config.aspnet_regiis一直告诉我:找不到配置部分’applicationSettings’.
我关注这个网站:Walkthrough: Creating and Exporting an RSA Key Container
我的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>
我使用命令:aspnet_regiis -pe“applicationSettings”-app“/ MyApplication”-prov“MyProvider”
当我在configSections上面移动Section configProtectedData时,它会加密applicationSettings,但是删除了configSections-Section,无论如何,IIS告诉我configSections需要是第一个元素.我不确定我做错了什么.
这是一个问题,applicationSettings是否在configSections中列出?
谢谢您的帮助.
如“configSections”中所述,“applicationSettings”是SectionGroup,而不是Section. aspnet_regiis只能加密Sections.
所以我不得不深入一点:aspnet_regiis -pe“applicationSettings / x.Properties.Settings”-app“/ MyApplication”-prov“MyProvider”

