Groups | Blog | Home
all groups > dotnet framework > may 2007 >

dotnet framework : configSource option in web.config



lf
5/30/2007 1:26:01 PM
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,

-pb-
5/31/2007 6:54:50 AM
[quoted text, click to view]

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
lf
5/31/2007 8:15:00 AM
pb
Thanks for your response. I think that I read though that you can only use
relative paths in the configSource attribute - not absolute paths. I get
what you're saying about compilation though - that is probably my problem,
but I wish I could find a workaround for this.

Thanks,
Linda

[quoted text, click to view]
AddThis Social Bookmark Button