473,800 Members | 2,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

looking for local / remote directory path solution

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
2 2268
You could store the path in a registry key on each machine and read it into
an Application variable in global.asax on Application_Sta rt.

"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
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.<machine name>.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_Sta rt.

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2405
by: Jaunty Edward | last post by:
Hi, can anybody refer me to a tool so that i can upload data from my local mysql DB to server DB without phpmyadmin. I have FTP and other access to server. my DB is like 100 MB. Regards Jaunty
1
400
by: enrique | last post by:
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/" />
3
2757
by: Daniel | last post by:
Is it possible to retain local file system read, write, delete access while impersonating for access to a remote drive in a different domain? I need to be able to move files from a local computer to a remote computer. do i have to copy them from the local computer to the remote computer then delete them fromt the local computer after undo-ing the impersonation? Or is there a way to retain access to both the local computer and the remote...
8
3402
by: nick | last post by:
I have a problem and I've been using a cheezy work around and was wondering if anyone else out there has a better solution. The problem: Let's say I have a web application appA. Locally, I set it up as C:\domains\appA. Locally, my IIS root points to C:\domains. I don't point it to C:\domains\appA since if I have an appB under C:\domains I wouldn't be able to get to it. So to access it via my browser I go to localhost/appA.
4
1718
by: Brian Pearson | last post by:
Hi, For a web application, is it possible to use something other than the \bin directory for local assemblies? I do not wish to use the GAC. My end goal is to have multiple websites use the same directory for local binaries. The only way for me to accomplish this now is to give them all the same home directory (which is not a good solution for me). Thanks,
8
9035
by: DEWright_CA | last post by:
Why does WebClient.DownloadFile loose my completed path? Ok, I have a function in my app then when my button is clicked it checks to see if the files come from a local drive or a http address. The portion of the code that pulls from the drive works great, but when the http address is active it changes the originating path to my C:\Windows\System32 folder instead of the proper path. I keep the path as a field on my form so I am certain...
6
3638
by: Brad | last post by:
I have a win2003 server workstation with multiple webs, each web has it's own ip address. In VS2005, if I select to open an existing web site, select Local IIS, the dialog correctly displays a list of all of my webs, however if I attempt to open a site under and web other than localhost I receive the message: "Unable to open the Web 'http://localhost/anywebappname'. The Web 'http://localhost/anywebappname' does not exist" Obviously...
2
4789
by: Vadim Malishev | last post by:
Hello, Can anybody help to solve the following problem? My Windows Service trying to access remote machine to get WindowsDirectory Property over Win32_OperatingSystem WMI class. Both servers are in the same Active Directory domain, so I create special active directory user and impersonate to it before invoke WMI. My code looks like:
20
6057
by: ram.rachum | last post by:
Hey, I'm looking for a good Python environment. That is, at least an editor and a debugger, and it should run on Windows. Does anyone have any idea?
0
10507
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10279
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10036
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7582
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6815
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4150
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2948
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.