Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web.config Versioning

Currently I am using a shared database model for our development. I know, it's better to use local development databases to do database versioning the right way without one developer breaking everyone else's code. So that's what I'm trying to get to. I have a question about the web.config file though. How do I ensure that once every dev has his own local development database, he doesn't have to manually change the DB connection string every time he gets an update from source control? What's the best way to do this?

For example, say Johnny Dev commits his web.config that holds a connection string like this:

server=JohnnysBox;database=JohnnyAppDev1;

So now Susie Dev gets an update and she has to change her connection string to this:

server=SUE;database=development;

So now Susie and Johnny keep committing their own connection strings to the web.config file, and every time they get an update, they have to change the connection strings in all applications.

What's the best way to handle this situation so that devs don't mess up each others' connection string settings, but can push other kinds of config file changes to all the other devs when necessary (like a new app setting)?

like image 460
Brandon Montgomery Avatar asked Dec 28 '22 07:12

Brandon Montgomery


1 Answers

It's only a partial solution, but you could have all the developers create an alias for their own SQL server using cliconfg.

Then the web.config in source control will have eg:

server=LocalServerAlias;database=development
like image 185
Chris Shaffer Avatar answered Jan 03 '23 19:01

Chris Shaffer