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.

http://stackoverflow.com/questions/6582970/separate-connectionstrings-and-mailsettings-from-web-config-possible

Here’s how it works:

image

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

 http://msdn.microsoft.com/en-us/library/ms254494%28v=vs.110%29.aspx

Leave a Reply

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