Reputation: 2929
I have a few web applications using the same databases. I'm deploying them all in the same "Web site" on IIS. The connection strings will be set at the "Web site" level and inherited in the "Applications". When I make a publish package, it gives me a list of the connection strings in the web.config but doesn't let me choose to remove them. I have to change the value or leave it empty (which uses the one in my local web.config).
The goal is to end up with a "clean slate" package that I can publish in different "Web site" that has their own connection strings (production server vs staging vs development for example). I want to be able to deploy a package to the staging environment for testing and, after testing, deploy that same package to production.
Upvotes: 0
Views: 721
Reputation: 2284
I would use web.config transformations to solve it. Then you can have different connection string for web.debug.config / web.production.config / we.test... and so on. You can replace in the connection string or the entire element. Here is a start: https://msdn.microsoft.com/en-us/library/dd465326%28v=vs.110%29.aspx
Upvotes: 2