I'm using GIT repository for my project. In my web.config I have a debug connection string to my local SQL server database. It won't work for anyone else. I cannot just put entire Web.config in .gitignore - the project wouldn't even compile.
A perfect solution would be to put the connection string in a separate file and make Web.config load it. Is it possible?
If not, is there any other solution? (using sql server CE won't work, because it breaks code first migrations)
You can move a single section of Web.config to a separate file.
In Web.config, write
<connectionStrings configSource="connectionStrings.config" />
Then, move the original element to a separate connectionStrings.config
(or any other filename) and add it to gitignore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With