Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn custom errors off when deploying to azure in debug mode only

Tags:

asp.net

azure

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?

like image 680
Tom Avatar asked May 31 '12 13:05

Tom


1 Answers

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>
like image 90
AvkashChauhan Avatar answered Sep 19 '22 18:09

AvkashChauhan