无法在windows 7/2008环境下使用aspnet_regiis加密web.config
我使用aspnet_regiis成功加密了在Windows 2003服务器上运行的web.config文件。但是,它在 Windows 7/2008 服务器上的 IIS 7 中不起作用。
当我尝试在 64 位 Windows 2008 服务器中运行以下命令时,它始终显示 aspnet_regiis 选项帮助。 Windows 7 操作系统中也是如此。
C:\Windows\Microsoft.Net\Framework64\v2.0.50727\aspnet_regiis –pe “appSettings” –app “/ConnectionTest” –site 4
如果我在 Windows 7 中打开 Visual Studio 2008 命令并运行以下命令,我会得到这些。我使用来自 iis 管理器的站点 ID。
aspnet_regiis –pe“appSettings” –app“/ConnectionTest” –站点 4 无法解析“4”的站点 ID 失败!
I used aspnet_regiis successfully encrypted web.config file which running on windows 2003 server. However it doesn't work in IIS 7 on Windows 7/2008 server.
When I try to run the followng command in 64bit Windows 2008 server, it always shows the aspnet_regiis options help. The same thing is in windows 7 OS.
C:\Windows\Microsoft.Net\Framework64\v2.0.50727\aspnet_regiis –pe “appSettings” –app “/ConnectionTest” –site 4
If I open Visual Studio 2008 command in windows 7 and run the following command, I got those. I use the site Id from iis manager.
aspnet_regiis –pe “appSettings” –app “/ConnectionTest” –site 4
Failed to resolve the site ID for '4'
Failed!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过“以管理员身份”运行命令窗口?这也让我困惑了一会,但以管理员身份运行修复了它。
Have you tried running a command window "As Administrator"? This just caught me out for a moment too but running as admin fixed it.
即使以管理员身份运行命令提示符后,我仍然收到此错误。但我观察到我的情况下的虚拟目录有多个用点分隔的单词。如“Web.Api.XYZApi”。
我将虚拟目录名称更改为“XYZApi”(没有点)并尝试加密并且它起作用了。但我仍然不确定为什么这会成为一个问题。
I was getting this error even after running command prompt as an administrator. But I observed that the virtual directory in my case had multiple words separated by dot. Like "Web.Api.XYZApi".
I changed the virtual directory name to "XYZApi" (without the dots) and tried encrypting and it worked. But I'm still not sure why that should be an issue.