我是一名开发人员,尝试在 ASP.NET 网站中加密我的 web.config 文件的一部分(这是我第一次尝试这样做……)。
由于各种语法更改都屡屡失败,所以最好在这里发布。以下是失败的一个示例(我将 web.config 复制到 c:\temp),cmd 提示符挂在 Visual Studio 2010 程序树上:
设置使用 Microsoft Visual Studio 2010 x86 工具的环境。
C:\Program Files\Microsoft Visual Studio 10.0\VC>aspnet_regiis -pef "applicationSettings/Webclient.Properties.Settings" "c:\temp" 正在加密配置部分... 未找到配置部分“applicationSettings/Webclient.Properties.Settings”。失败!
C:\Program Files\Microsoft Visual Studio 10.0\VC>
- 最初,我在这里提出了这个问题(3 天后没有真正的帮助):
- 然后我在这里发布问题寻求帮助:
http://forums.asp.net/t/1748951.aspx/1?如何获取 ASPNET_REGIIS 以加密我的 Web 配置文件的一部分
- 我寻求帮助的最新论坛:
- 这里是网页配置:
<?xml version="1.0"?> <configuration> <configSections> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <section name="WebClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <section name="FileServiceProxy.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> </sectionGroup> </configSections> <applicationSettings> <WebClient.Properties.Settings> <setting name="GROUPERpassword" serializeAs="String"> <value>12345abcde</value> </setting> <setting name="MARLINpassword" serializeAs="String"> <value>abcdef12345</value> </setting> </WebClient.Properties.Settings> <FileServiceProxy.Properties.Settings> <setting name="FileServiceProxy_ASMXproxy_FileService" serializeAs="String"> <value>http://MDWDATA/sdkTrimFileServiceASMX/FileService.asmx</value> </setting> </FileServiceProxy.Properties.Settings> </applicationSettings> <connectionStrings/> <system.web> <trace enabled="false" pageOutput="true" requestLimit="40" localOnly="false"/> <compilation debug="false" targetFramework="4.0"> </compilation> <customErrors mode="Off" defaultRedirect="GenericErrorPage.htm"/> <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/> <httpRuntime maxRequestLength="65536" /> </system.web> <system.webServer> <defaultDocument> <files> <remove value="default.aspx" /> <remove value="index.cfm" /> <remove value="iisstart.htm" /> <remove value="index.html" /> <remove value="index.htm" /> <remove value="Default.asp" /> <remove value="Default.htm" /> <remove value="FileService.asmx" /> <add value="ColdFusionFormPOSTtoGROUPER.htm" /> </files> </defaultDocument> <security> <requestFiltering> <requestLimits maxAllowedContentLength="67108864" /> </requestFiltering> </security> <tracing> <traceFailedRequests> <add path="*"> <traceAreas> <add provider="ASP" verbosity="Verbose" /> <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" /> <add provider="ISAPI Extension" verbosity="Verbose" /> <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,FastCGI" verbosity="Verbose" /> </traceAreas> <failureDefinitions statusCodes="401.3,500" /> </add> </traceFailedRequests> </tracing> </system.webServer> </configuration>