By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,635 Members | 2,227 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,635 IT Pros & Developers. It's quick & easy.

looking for local / remote directory path solution

P: n/a
Hello everyone,

I'm looking for a "directory path" solution that will allows me to test my
app locally and then test on remote web server without having to update my
web.config file each time I modify the file. In other words I'm storing the
paths (for centralizing purposes) as custom <appSettings> in the web.config.

expample (for local testing):
<add key="imagePath" value="http://localhost/app_folder/10_media/images/" />

expample (for remote testing):
<add key="imagePath" value="http://www.domain.com/10_media/images/" />

Is there a way to have the app run the local path when testing locally and
vice versa without manually changing the web.config ?

Any thoughts/solutions will be appreciated!

Thanks,
Enrique
Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You could store the path in a registry key on each machine and read it into
an Application variable in global.asax on Application_Start.

"enrique" wrote:
Hello everyone,

I'm looking for a "directory path" solution that will allows me to test my
app locally and then test on remote web server without having to update my
web.config file each time I modify the file. In other words I'm storing the
paths (for centralizing purposes) as custom <appSettings> in the web.config.

expample (for local testing):
<add key="imagePath" value="http://localhost/app_folder/10_media/images/" />

expample (for remote testing):
<add key="imagePath" value="http://www.domain.com/10_media/images/" />

Is there a way to have the app run the local path when testing locally and
vice versa without manually changing the web.config ?

Any thoughts/solutions will be appreciated!

Thanks,
Enrique

Nov 22 '05 #2

P: n/a
Hello,

I had the same problem, but think that I have solved it in a simple and
ellegant way (at least it proved very useful for me):
Just defined a custom configuration library that handles reading of XML
configuration files. And the library supports 'include files' based on
some predefined criteria, such as machine name. In my applications it
simply loads master config file and config.<machinename>.xml include
file that contains machine-specific settings.
In web.config I store only relative path to my master config file, so I
can distribute the web.config without any modification to different
machines. I also distribute all config files (for all machines) together
with the app, so all installations contain the same files.
And that's all. My library has grown a bit and now supports quite a lot
of features besides configuration, but it is not open source yet - maybe
someday. I'm sure you can make something similar in a hour or two, so
probably you won't wait for me anyway.

Best regards,
Rafal Gwizdala

Jamie Manstream wrote:
You could store the path in a registry key on each machine and read it into
an Application variable in global.asax on Application_Start.

"enrique" wrote:

Hello everyone,

I'm looking for a "directory path" solution that will allows me to test my
app locally and then test on remote web server without having to update my
web.config file each time I modify the file. In other words I'm storing the
paths (for centralizing purposes) as custom <appSettings> in the web.config.

expample (for local testing):
<add key="imagePath" value="http://localhost/app_folder/10_media/images/" />

expample (for remote testing):
<add key="imagePath" value="http://www.domain.com/10_media/images/" />

Is there a way to have the app run the local path when testing locally and
vice versa without manually changing the web.config ?

Any thoughts/solutions will be appreciated!

Thanks,
Enrique

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.