473,715 Members | 6,043 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How best to determine if running in a development, test, or production mode?

I want to develop a single web app that will be run in three
environments: development, test, and production. The test and prodc.
will be on the same machine under different directories. I wish to
have same type of file, configuration string, etc. in the root
directory of each environment to tell the program where it is running.
I will use this to determine what connection string, sql, etc. to use.

Currently, I am using 3 different WEB_CONFIG files. but this is a pain
to keep in sync and I live in fear of copying the wrong one to
production!

I tried merging two appending files into WEB_CONFIG file,
"<appSettin gs file="xxx"/>, but this does not work.

Should one place some control file in the root directory and use the
"erver.MapPath( "/");" command to get the path for the file.

Also, I have very limited control over the testing/prod machine so I
can not make any larger system level change without permissions from
the evil web master!!!

Thoughts?

Thanks

Nov 19 '05 #1
3 1814
you can reference an external configuration file that will be automatically
merged at run time, by using the appsettings node. If the external file is
present, ASP.NET will combine the appSettings values from web.config with
those in the external file. If a key/value pair is present in both files,
ASP.NET will use the value from the external file. e.g.

<appSettings file="dev_setti ngs.config"/>

Cathal
"David" <ma******@sbcgl obal.net> wrote in message
news:hk******** *************** *********@4ax.c om...
I want to develop a single web app that will be run in three
environments: development, test, and production. The test and prodc.
will be on the same machine under different directories. I wish to
have same type of file, configuration string, etc. in the root
directory of each environment to tell the program where it is running.
I will use this to determine what connection string, sql, etc. to use.

Currently, I am using 3 different WEB_CONFIG files. but this is a pain
to keep in sync and I live in fear of copying the wrong one to
production!

I tried merging two appending files into WEB_CONFIG file,
"<appSettin gs file="xxx"/>, but this does not work.

Should one place some control file in the root directory and use the
"erver.MapPath( "/");" command to get the path for the file.

Also, I have very limited control over the testing/prod machine so I
can not make any larger system level change without permissions from
the evil web master!!!

Thoughts?

Thanks

Nov 19 '05 #2
Can one Merge two appsettings files? I tried and got an error. Eg.
one for the specific environment and one for the general settings.

On Sat, 23 Jul 2005 02:37:27 +0100, "Cathal Connolly [C# MVP]"
<cc*******@eg-consulting.com> wrote:
you can reference an external configuration file that will be automatically
merged at run time, by using the appsettings node. If the external file is
present, ASP.NET will combine the appSettings values from web.config with
those in the external file. If a key/value pair is present in both files,
ASP.NET will use the value from the external file. e.g.

<appSettings file="dev_setti ngs.config"/>

Cathal
"David" <ma******@sbcgl obal.net> wrote in message
news:hk******* *************** **********@4ax. com...
I want to develop a single web app that will be run in three
environments: development, test, and production. The test and prodc.
will be on the same machine under different directories. I wish to
have same type of file, configuration string, etc. in the root
directory of each environment to tell the program where it is running.
I will use this to determine what connection string, sql, etc. to use.

Currently, I am using 3 different WEB_CONFIG files. but this is a pain
to keep in sync and I live in fear of copying the wrong one to
production!

I tried merging two appending files into WEB_CONFIG file,
"<appSettin gs file="xxx"/>, but this does not work.

Should one place some control file in the root directory and use the
"erver.MapPath( "/");" command to get the path for the file.

Also, I have very limited control over the testing/prod machine so I
can not make any larger system level change without permissions from
the evil web master!!!

Thoughts?

Thanks


Nov 19 '05 #3
Here's an article that I saw recently that discusses an approach to this:

http://www.codeproject.com/aspnet/We...dification.asp

-Brock
DevelopMentor
http://staff.develop.com/ballen
Can one Merge two appsettings files? I tried and got an error. Eg.
one for the specific environment and one for the general settings.

On Sat, 23 Jul 2005 02:37:27 +0100, "Cathal Connolly [C# MVP]"
<cc*******@eg-consulting.com> wrote:
you can reference an external configuration file that will be
automatically merged at run time, by using the appsettings node. If
the external file is present, ASP.NET will combine the appSettings
values from web.config with those in the external file. If a
key/value pair is present in both files, ASP.NET will use the value
from the external file. e.g.

<appSettings file="dev_setti ngs.config"/>

Cathal
"David" <ma******@sbcgl obal.net> wrote in message
news:hk******** *************** *********@4ax.c om...
I want to develop a single web app that will be run in three
environments: development, test, and production. The test and
prodc. will be on the same machine under different directories. I
wish to have same type of file, configuration string, etc. in the
root directory of each environment to tell the program where it is
running. I will use this to determine what connection string, sql,
etc. to use.

Currently, I am using 3 different WEB_CONFIG files. but this is a
pain to keep in sync and I live in fear of copying the wrong one to
production!

I tried merging two appending files into WEB_CONFIG file,
"<appSettin gs file="xxx"/>, but this does not work.

Should one place some control file in the root directory and use the
"erver.MapPath( "/");" command to get the path for the file.

Also, I have very limited control over the testing/prod machine so I
can not make any larger system level change without permissions from
the evil web master!!!

Thoughts?

Thanks


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
9257
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
136
9412
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to use. The above URL is version 1.0 (draft) that resulted. IMO, it is not a replacement for the FAQ,...
4
2623
by: Collin Peters | last post by:
I have searched the Internet... but haven't found much relating to this. I am wondering on what the best practices are for migrating a developmemnt database to a release database. Here is the simplest example of my situation (real world would be more complex). Say you have two versions of your application. A release version and a development version. After a month of developing you are ready to release a new version. There have...
0
1809
by: Ken Allen | last post by:
The MSDN documentation on remote debugging is a bit sparse, to say the least, and there is almost no information available on the 'best' way to configure this. I should note that my development system is Windows XP Pro and the test machine is Windows 2003, both running the latest upgrades; Visual Studio 2005 is installed on the development system and the .Net 2.0 framework is installed on the test system. The two systems do not have the...
1
1785
by: DBxGlock | last post by:
Howdy folks, Recently we copied a .NET 1.1 aspx page and dll to a production server. The page had a web reference to a service that we have running on the production server, as well as another version running on the test server. Everything ran fine in production until the test server went down, and we noticed that the page that was put on the production machine had its web reference pointing to the web service on the test machine. Is...
4
2947
by: Richard Levasseur | last post by:
(Forewarning, most of these problems and solutions come from being the only developer in a 1 server department with no budget, few resources, unresponsive IT, and non-technical managers, so thats where I'm coming from.) (Additionally, this may or may not fit in this group, but I know there's bright people here, and it is largely PHP development centric) Any time I've done web development, I've always been plagued by some of the...
3
1456
by: PeterKellner | last post by:
I have a project where a html designer gives me a pile of html to wire up. I do that and it works fine of course. Then, the html designer makes a bunch of changes, give me back the revised aspx file and of course it always gives compiler errors. I've asked the designer not to remove any controls, div tags etc. The problem is the errors always point to lines that are not the problem. Could someone suggest a better way to work with...
56
5189
by: Zytan | last post by:
Obviously you can't just use a simple for loop, since you may skip over elements. You could modify the loop counter each time an element is deleted. But, the loop ending condition must be checked on each iteration, since the Count changes as you delete elements. I would think it is guaranteed to be computed each time, and not cached. So, is this the best way?
10
3923
by: Brendan Miller | last post by:
What would heavy python unit testers say is the best framework? I've seen a few mentions that maybe the built in unittest framework isn't that great. I've heard a couple of good things about py.test and nose. Are there other options? Is there any kind of concensus about the best, or at least how they stack up to each other? Brendan
0
8821
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8718
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9196
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...
1
9103
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9047
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
7973
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
6646
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...
2
2539
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2118
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.