views:

59

answers:

3

I am using CruiseControl.Net for my continuous integration process. Using ccnet I build and publish my asp.net application into a server in Release mode. But I am not able to change debug="true" to debug="false" in my Web.Config during publishing. What can I do?

+1  A: 

You might consider using a Web Deployment Project (WDP) which can be run as part of your visual studio build configuration. The WDP will handle things like toggling the debug setting and it change any environment-specific web.config settings as well. Here's a WDP tutorial.

Ben Griswold
A: 

If you are calling a msbuild script from ccnet you could use the XmlUpdate task from the MSBuild Community Tasks Project.

<XmlUpdate
    XPath="/configuration/system.web/compilation/@debug"
    XmlFileName="$(WebConfigFileFullPath)"
    Value="false" />

I documented my build process here if you are interested.

Tom Brothers
A: 

Expanding on Tom Brothers' answer above, we use the <XmlMassUpdate> task in MSBuild Community Tasks to merge a deployment-specific web.config that contains multiple changes to apply to the base web.config to change the debug setting, connection strings, logging configuration, etc. So a web project contains web.config with the configuration necessary to run from the development machines. There's also web.Release.config file which contains only the changes that we need to apply to web.config to produce the configuration on the production web server.

Since the extra file only contains changes (deltas) to apply to web.config, it's not very big. Visual Studio ignores it during development, and CruiseControl.Net applies the changes to web.config when it gets deployed to the web server.

Carl Raymond