aspnet_regiis -pe 在.net v4.0.30319 中找不到我的配置部分
我已将新的 Settings.settings 文件添加到我的 ASP.NET Webclient 项目中;我在加密该部分时遇到问题。在定位到该目录的 cmd 窗口中:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>
这是我的语法:
aspnet_regiis -pe "Webclient.Properties.Settings" -app "/sdkTrimFileServiceASMXclient"
输出:
Encrypting configuration section...
The configuration section 'Webclient.Properties.Settings' was not found.
Failed!
我的项目名为 Webclient;我单击了“设置”选项卡并添加了 2 个元素。 Visual Studio 2010 添加了 Settings.settings 文件并更新了我的 web.config,如下所示:
<configSections>
<sectionGroup name="applicationSettings"
type="System.Configuration.ApplicationSettingsGroup, System, Version=2.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=2.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>
我也尝试过这种语法(即只是 "Webclient" 而不是 "Webclient.Properties.Settings"< /strong>),我遇到了与上面相同的失败。
aspnet_regiis -pe "Webclient" -app "/sdkTrimFileServiceASMXclient"
在我的 IIS 6.0 Windows 2003 Server 计算机上的默认网站中,我有一个名为:sdkTrimFileServiceASMXclient 的虚拟目录 物理
目录的本地路径:C:\ ProjectsVS2010\sdkTrimFileServiceASMX\WebClient
我不知道我在这里做错了什么。
------------------------------ 编辑更新 ------------------ --------- 2011 年 12 月 13 日 有人建议尝试这种语法(但我得到了同样的错误):
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pe "applicationSettings/Webclient" -app "/sdkTrimFileServiceASMXclient"
Encrypting configuration section...
The configuration section 'applicationSettings/Webclient' was not found.
Failed!
I've added a new Settings.settings file to my ASP.NET Webclient project; I am having a problem encrypting the section. In the cmd window positioned to this directory:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>
Here is my syntax:
aspnet_regiis -pe "Webclient.Properties.Settings" -app "/sdkTrimFileServiceASMXclient"
Output:
Encrypting configuration section...
The configuration section 'Webclient.Properties.Settings' was not found.
Failed!
My project is called Webclient; I clicked on the Settings tab and added 2 elements. Visual Studio 2010 added the Settings.settings file and updated my web.config as follows:
<configSections>
<sectionGroup name="applicationSettings"
type="System.Configuration.ApplicationSettingsGroup, System, Version=2.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=2.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>
I have also tried this syntax (i.e. just "Webclient" rather than "Webclient.Properties.Settings") and I get the same failure as above.
aspnet_regiis -pe "Webclient" -app "/sdkTrimFileServiceASMXclient"
In the Default Web Site on my IIS 6.0 Windows 2003 Server machine, I have a virtual directory called: sdkTrimFileServiceASMXclient
The local path to the physical directory: C:\ProjectsVS2010\sdkTrimFileServiceASMX\WebClient
I can't figure out what I'm doing wrong here.
------------------------------ EDIT UPDATE --------------------------- 13 Dec 2011
A suggestion was made to try this syntax (but I got the same error):
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pe "applicationSettings/Webclient" -app "/sdkTrimFileServiceASMXclient"
Encrypting configuration section...
The configuration section 'applicationSettings/Webclient' was not found.
Failed!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在脚本中尝试使用
"applicationSettings/WebClient"
而不是仅"WebClient"
。正如 @John Adams 在下面的评论中所说,此命令区分大小写。
Try
"applicationSettings/WebClient"
instead of just"WebClient"
in your script.This command is case sensitive, as @John Adams said in his comment below.
作者:@John Adams
“在另一个论坛上,有人指出真正的问题是 XML 区分大小写,并且在命令中我需要指定“applicationSettings/WebClient”而不是“applicationSettings/Webclient”。当然,在 web.config 中找不到该拼写。最后,请注意可以编辑答案的人:改进答案以反映我添加的评论。”
By @John Adams
"On a different forum, someone pointed out that the real problem was the fact that the XML is case-sensitive and that in the command, I needed to specify 'applicationSettings/WebClient' instead of 'applicationSettings/Webclient'. The latter was, of course, not found in the web.config with that spelling. Finally, case closed. NOTE to someone who can EDIT the answer: improve the answer to reflect this comment added by me. Thanks"
这不是最佳解决方案,但将文件名更改为
web.config
应该可以完成任务。It is not an optimal solution, but changing the name of a file to
web.config
should do the job.