I use ConfigSource=localfile to keep my connectionstrings in a separate file on the productiton server. This works great.
But if you use IIS7 Manager to edit connectionstrings on the server, the strings end up back in the web.config. Subsequent deployments then trash those edits when the new web.config arrives.
II7, if it edits your connection (or appsettings) strings, should put them back in the file from whence they came.
no?
Indeed, it even seems that somewhere in this sequence the original localfile gets truncated (to just the header line in an xml file) ... which then errors out after the next deployment.