Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer
    
This doesn't seem to be the case. When I deleted my ConnectionStrings section from my web.config, and published it to my IIS server, it always overwrites any connection strings I set with the remote IIS manager (as the IIS manager is writing it to web.config, which is being overwritten) –  KallDrexx Apr 24 '11 at 19:31
    
I would make sure that you are modifying the correct web.config file for your publishing settings. i.e. if you are publishing to prod, make sure you are editing your prod web.config. –  BoxerBucks Apr 25 '11 at 12:37
    
How do I tell remote IIS manager what web.config to edit though? The issue is that remote IIS manager is updating it's web.config, but the publish action pushes the development web.config up (which is sometimes needed if I have non-prod only settings change) which overwrites any changes made by the Remote IIS Manager –  KallDrexx Apr 25 '11 at 13:36
    
I meant in visual studio. Since there are different transforms for the different deployment types, make sure you are editing and then deploying the correct web.config. –  BoxerBucks Apr 25 '11 at 13:54
1  
Ok, I think I am understanding your issue. So you want the settings you specify in the IIS manager console to persist but you also want the web.config settings from VS to apply to that file also? If this is the case, then I don't think that's possible with web deploy. It's going to either write one of the files or the other. AFAIK you can't have your VS web.config file merge its settings in with the server side web.config. –  BoxerBucks Apr 25 '11 at 16:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.