[quoted text, click to view] On 30 May, 21:26, lf <l...@discussions.microsoft.com> wrote:
> I have a web.config file and I want to externalize my connectionStrings
> setting so that it points to a separate file like so:
>
> <connectionStrings configSource=".\subdir\connectionstrings.config">
>
> However, I am attempting to encrypt this in code. (I can't use
> aspnet_regiis because I need this to work for app.config files and on a build
> machine as well.)
> When I try to protect this file, it indicates that my
> "connectionstrings.config" file is missing. When I use filemon, I can see
> that it is looking in my c:\windows\microsoft.net\framework\v2.0.50727\subdir
> directory instead of the subdirectory in which my config that I am protecting
> is located. Can anyone tell me what's happening here? I have also tried
> locating it in the same directory to no avail.
>
> thanks in advance,
>
> Linda
I am too sure about this but What I had observecd is when you run and
web application, it first gets compile and when it gets complied it is
placed under c:\windows\microsoft.net\framework\v2.0.50727 directory
and later gets executed from there. What you can do is instead og
using relative path to the connectionstrings.config file use absolute
path in the web config file.
I hope this helps