Live vs Development connection strings
c#, connection-string, visual-studio-2010
Solution
If you're developing an ASP.NET application you can use `web.config` transforms to easily specify what will be different between each environment. The build process will generate an appropriate `web.config` for whatever environment you're targeting.
If you're building a desktop application, I'd look into Slow Cheetah which allows you to use the same `web.config` transform feature on any xml file you like, including an `app.config`. We've used this on a number of the projects at my company to streamline the deployment process between our various environments.
Problem
We have a development database and a production database. What I am trying to prevent is having to change: ``` connectionString="Data Source=server;Initial Catalog=test; connectionString="Data Source=server;Initial Catalog=live; ``` We have two places we deploy the site. One for testing and one is live. Is there an easy way to prevent us from having to change the connection string every time we want to upload to test or live? We use team foundation server, I have no idea how to set up a build server or build definitions so looking for something simple if there is anything.