So I recently found out about how Remote IIS can manage the Asp.net properties of my web site, such as connection strings, smtp settings etc.. Managing it through IIS rather than through web.config transforms means it's much easier to deploy settings without having to store my database connectionstring (with credentials!) in source control, as well as other critical data that's only relevant to the production system but no relevance to development.
However, whenever I add/change settings via Remote IIS, those changes are reverted the next time I publish my site (because remote IIS manager is writing the changes to web.config and thus web.config gets overwritten with my local copy).
Is there any way to get the Asp.net settings that were changed via the Remote IIS Manager to persist after future publishes?
The server is running IIS 7.
Delete the settings in web.config that you want to set in IIS and when you deploy, they will not be overwritten. It sounds like you are leaving the default connection string settings in the web.config file and they are overwriting the IIS settings that you are specifying.