Extract Connection Strings to an external file from web.config

I found this on StackOverflow, so I posted a link to it here for my own future reference.

You can abstract (or extract) the Connection Strings for your Asp.Net out of Web.Config and keep them in a separate file. This is helpful if each developer needs their own connection strings defined. You would *not* want to include this file in the tracked files of your repo, or else each developer’s file would get updated with any changes.


Here’s how it works:


Here’s a link to the MSDN document explaining it in greater detail:


Leave a Reply

Your email address will not be published. Required fields are marked *