Is it possible to instruct the aspnet_compiler to set debug=false in the web.config?
My intention is to automate this as part of the nant build process. I am open to suggestions other than xml parsing
Have you thought about using <xmlpoke>
?
<xmlpoke file="${Build.WebConfig}"
xpath="/configuration/system.web/compilation/@debug"
value="false">
</xmlpoke>
NAnt Home Page
XML Poke Documentation
I would suggest using entirely different config files for each environment(prod, test, staging in our case). Depending on the build you would just use the required config, no mess, less fuss. Hanselmen has example on how to do this in Visual Studio and if you read the first comment Phil Hack has got it working with NAnt.
<target name="configMerge">
<copy file="${sourcefile}"
tofile="${destinationfile}" overwrite="true">
<filterchain>
<expandproperties />
</filterchain>
</copy>
</target>
In Addition, if you are using VS 2010 you can now use web.config transforms
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With