Mark Frishman said:
Is there a way to have some kind of an install modify Web.config when
installing on the production server. One obvious use is to flip
<compilation debug="true"> setting. I want to be able to reuse the
development version of that file from source control on the production
machine with a small set of modifications.
As you're probably aware, you can vary the <appSettings> portion of
web.config by using a user.config file. In the web.config:
<configuration>
<appSettings file="user.config">
<add .... />
</appSettings>
....
</configuration>
in user.config in the same directory:
<appSettings>
<adds or removes or clear />
...
</appSettings>
Note that there is no "file=" in user.config, and that <appSettings> is the
root element there: no <configuration> element.
If user.config is not present, then there is no error and the web.config
settings are used. If user.config is present, the settings in user.config
will be used to modify the settings in web.config.
What we do is to have web.config, in source control, have the Production
settings. Each developer may have his own user.config to configure the web
application for his own workstation. user.config is not made part of the
project, so it is not deployed to production, so the web.config settings
take over.
Of course, this doesn't help you with things like the <remoting> section...