473,654 Members | 3,062 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best practices for deployment from dev to stage to production

We have different settings for our development, stage and production
environments. For example, our development environment connection strings
point to development database instances, stage connection strings point to
stage database instances and so forth.

Without having to maintain separate web.config files, what are the various
approaches to having environment-specific settings?
Oct 19 '06 #1
2 4548
Uli
Hi,

here is the way I'm doing it.

Set a machine identity in the machine.config that says if it is a
development, stage or production server (e.g. d, s or p. It might be good to
add an "l" for local also).

for the Development-server
<add key="ApplEnv-l" value="d" />
Then you can put the connection strings for all environments into the
web.config

<add key="Connection String-l" value="server=( local);......."/>
<add key="Connection String-d" value="server=D EV-Server;......"/>
<add key="Connection String-s" value="server=S TG_Server;..... "/>
<add key="Connection String-p" value="server=P RD-Server;....."/>

In your code put something like:

private static string DbConnectionStr ing
{
get
{
string strApplEnv = ConfigurationSe ttings.AppSetti ngs["ApplEnv"];
string paramSuffix = strApplEnv.ToLo wer().Substring (0,1);
return ConfigurationSe ttings.AppSetti ngs["ConnectionStri ng-" +
paramSuffix] ;
}
This way you can use the web.config for all environments.

Regards,
Uli
--
Wer nicht fragt, stirbt dumm.
If you don''t ask, you'll die as a dumba**.
"dasomervil le" wrote:
We have different settings for our development, stage and production
environments. For example, our development environment connection strings
point to development database instances, stage connection strings point to
stage database instances and so forth.

Without having to maintain separate web.config files, what are the various
approaches to having environment-specific settings?
Oct 27 '06 #2
Uli
sorry, it has to be:

<add key="ApplEnv" value="d" />
and not
<add key="ApplEnv-l" value="d" />
--
Wer nicht fragt, stirbt dumm.
If you don''''''''t ask, you''''''''ll die as a dumba**.
"Uli" wrote:
Hi,

here is the way I'm doing it.

Set a machine identity in the machine.config that says if it is a
development, stage or production server (e.g. d, s or p. It might be good to
add an "l" for local also).

for the Development-server
<add key="ApplEnv-l" value="d" />
Then you can put the connection strings for all environments into the
web.config

<add key="Connection String-l" value="server=( local);......."/>
<add key="Connection String-d" value="server=D EV-Server;......"/>
<add key="Connection String-s" value="server=S TG_Server;..... "/>
<add key="Connection String-p" value="server=P RD-Server;....."/>

In your code put something like:

private static string DbConnectionStr ing
{
get
{
string strApplEnv = ConfigurationSe ttings.AppSetti ngs["ApplEnv"];
string paramSuffix = strApplEnv.ToLo wer().Substring (0,1);
return ConfigurationSe ttings.AppSetti ngs["ConnectionStri ng-" +
paramSuffix] ;
}
This way you can use the web.config for all environments.

Regards,
Uli
--
Wer nicht fragt, stirbt dumm.
If you don''t ask, you'll die as a dumba**.
"dasomervil le" wrote:
We have different settings for our development, stage and production
environments. For example, our development environment connection strings
point to development database instances, stage connection strings point to
stage database instances and so forth.

Without having to maintain separate web.config files, what are the various
approaches to having environment-specific settings?
Oct 28 '06 #3

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

Similar topics

6
4656
by: JStrummer | last post by:
I have a question regarding paths and the include() statement in PHP. I develop in a Windows environment and will be publishing to a Linux server. I would like to do the following: 1. Setup my include references in such a way that I don't have to change them all every time I have to publish to the production server 2. Setup above in such a way that won't involve php.ini (& LInux equivalent), as I have access to edit this file...
136
9301
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,...
2
3413
by: sstevens | last post by:
Does anyone have suggesstions for ASP.NET deployment best practices. This is in the context of a large organization where developers do not have admin access to web servers. The idea of buliding msi packages for each deploy seems difficult to implement because the server admins do not have the time to constantly be running msi's and moving applications between environments. Are there any proven products that can automate this process for...
3
1286
by: Derek Martin | last post by:
Hi list, I have been doing VB.Net for quite a while now and just now getting into the forray of ASP.Net using VS2003. I have created our development website and now we are ready to start putting it into production. I've messed around with a few different deployment scenarios but the one we ended up with was two copies of the code, one on dev and one on prod and all changes we make to code on dev have to be copied to the prod and then...
2
1186
by: Terry Mulvany | last post by:
Hello group, Curious as to how you all have chosen to deploy/publish your asp.net apps. Currently though we have a local dev environment, then we stage to a QA server then we publish/deploy. In previous jobs I've always used straight xcopy to publish to production (usually via the Copy Project option in VS.Net). The way I understand it, your choices are you can xcopy or use an MSI. What are the benefits of each and if there is no need to...
10
3436
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read somewhere that each folder under the "web site" is compiled in separate assembly. I however, did not find that the "web site" creation in vs.net 2005 created any AssemblyInfo.cs file.
1
1828
by: jimdandy | last post by:
Hi all, Am looking for some guidance/advice in terms of best practices for deploying a MS BI project. We have a relatively large BI system that we need to deploy between DEV/QA/UAT/PROD and want a simple way to manage this deployment between environments. The system consists of: SQL Server 2005 Catabases, tables, views, sprocs, security scripts,
1
1749
by: jason | last post by:
In a small shop with 3 .net developers. What would typically be considered a good deployment practice if there is a chance of developers might be working on the same websites at the same time? Do most developers work on the desktop and deploy individual sources using xcopy compiling on the remote web servers? I noticed VS.NET acts kinda strange when just images are opened with other tools while you attempt to added them to a project....
20
10020
by: Joe | last post by:
Is any one charting packing considered to be the "best"? We've used ChartFX but wasn't too happy about the way data had to be populated along with some other issues which slip my mind right now and Dundas has bugs and doesn't do a good enough job displaying axis labels and is very slow to paint large numbers of series and data points. We're currently evaluating ProEssentials which we are happy with but it's not a native .NET package. ...
0
8376
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
8290
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,...
1
8489
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
8594
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
7307
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
6161
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
5622
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();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2716
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

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.