问题描述
我使用这个命令encrypying我的.NET配置文件,它工作得很好:
I am encrypying my .NET config file using this command and it works just fine:
aspnet_regiis -pe "connectionStrings" -app "/SampleApplication"
对于这个工作,虽然我已经有一个名为SampleApplication指着我的web.config文件的文件夹下的一个虚拟目录。
For this to work though I have to have a virtual directory called SampleApplication pointing to the folder my web.config file is under.
有没有办法只指定文件路径,而不是必须有一个虚拟目录?
Is there a way to just specify the path to the file and not have to have a virtual dir?
我试着用
aspnet_regiis -pe "connectionStrings" -location "c:\FoldercontainingWebConfigFile"
但我得到的错误:路径属性必须是相对虚拟路径。而且不能包含任何:\等等......
but i get the error: " path attribute must be a relative virtual path". And cannot contain any of ":" "\" etc...
我期待在这里: http://msdn.microsoft.com/en -us /库/ k6h9cz8h%28V = VS.80%29.aspx
有没有办法做到这一点?
Is there any way to do this?
推荐答案
我得到了它!
-pefsectionName包含的web.config文件完整路径的目录
-pef "sectionName" "full path to directory containing web.config file"
这篇关于加密web.config文件并提供该文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!