I am working on a site where we use Web.Debug.config with transform XSLT to turn custom errors off
<customErrors mode="Off" xdt:Transform="Replace"/>`
However this doesn't seem to be taken into consideration when deploying to azure.
From
Azure web.config per environment
I can see that azure uses .cscfg files, and that what I am trying to accomplish will probably involve these files? What is the simplest way to turn custom errors off when deploying to azure but only when in debug?
The fact is that anything you will add into web.release.config or web.debug.config will not be included in the final web.config which will be the part of your application Package (CSPKG) deployed to Windows Azure. If you wish to have certain web.config settings part of your Windows Azure application, you will have to explicit define in web.config.
To turn custom errors Off, you would add the following explicitly in web.config:
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
......
<system.web>
<customErrors mode="Off" xdt:Transform="Replace"/>
</system.web>
.....
</configuration>
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