title: HttpContext.Current.IsDebuggingEnabled always true
body: <p>Why my site is running debug mode?</p>
  
  <p>HttpContext.Current.IsDebuggingEnabled is always true!</p>
  
  <p>Bundles not working!</p>
  
  <p>Although #if DEBUG is false so DEBUG is not defined!</p>
  
  <p>Precompilation is enabled on my appharbor app.</p>
  
  <p>In my Web.Release.config I remove debug:</p>
  
  <pre><code>&lt;system.web&gt;
      &lt;compilation xdt:Transform="RemoveAttributes(debug)" /&gt;
  &lt;/system.web&gt;
  </code></pre>
  
  <p>Online Transformation Tester give me this result tested with my Web.config and Web.Release.config:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!--
    Para obtener más información sobre cómo configurar la aplicación de ASP.NET, visite
    http://go.microsoft.com/fwlink/?LinkId=169433
    --&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
      &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
    &lt;/configSections&gt;
    &lt;connectionStrings&gt;
      &lt;add name="DefaultConnection" connectionString="Data Source=9831a429-a608-4055-8bb9-a2bb016f79a3.sqlserver.sequelizer.com;Initial Catalog=db9831a429a60840558bb9a2bb016f79a3;user id=wgomqcwgmezvqifh;password=JqgJKAdNmPvR6ZSwsVJYZtP7VYE2pZaTmn6Mntozm4r8TjtMAEFZRwzqHhVT4kxu;MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" /&gt;
      &lt;add name="StorageConnectionString" connectionString="UseDevelopmentStorage=true" /&gt;
    &lt;/connectionStrings&gt;
    &lt;appSettings&gt;
      &lt;add key="webpages:Version" value="3.0.0.0" /&gt;
      &lt;add key="webpages:Enabled" value="false" /&gt;
      &lt;add key="ClientValidationEnabled" value="true" /&gt;
      &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
      &lt;add key="TwitterKey" value="{TwitterKey}" /&gt;
      &lt;add key="TwitterSecret" value="{TwitterSecret}" /&gt;
      &lt;add key="FacebookKey" value="{FacebookKey}" /&gt;
      &lt;add key="FacebookSecret" value="{FacebookSecret}" /&gt;
      &lt;add key="MicrosoftKey" value="{MicrosoftKey}" /&gt;
      &lt;add key="MicrosoftSecret" value="{MicrosoftSecret}" /&gt;
      &lt;add key="AnalyticsCode" value="{AnalyticsCode}" /&gt;
      &lt;add key="AnalyticsDomain" value="{AnalyticsDomain}" /&gt;
      &lt;add key="CrawlerServiceApiId" value="{CrawlerServiceApiId}" /&gt;
      &lt;add key="CrawlerServiceApplication" value="{CrawlerServiceApplication}" /&gt;
      &lt;add key="CrawlerServiceEndPoint" value="{CrawlerServiceEndPoint}" /&gt;
      &lt;add key="EmailServer" value="{EmailServer}" /&gt;
      &lt;add key="EmailUser" value="{EmailUser}" /&gt;
      &lt;add key="EmailPassword" value="{EmailPassword}" /&gt;
    &lt;/appSettings&gt;
    &lt;system.web&gt;
      &lt;authentication mode="None" /&gt;
      &lt;compilation targetFramework="4.5.1" /&gt;
      &lt;httpRuntime targetFramework="4.5.1" /&gt;
      &lt;pages&gt;
        &lt;namespaces&gt;
          &lt;add namespace="System.Web.Helpers" /&gt;
          &lt;add namespace="System.Web.Mvc" /&gt;
          &lt;add namespace="System.Web.Mvc.Ajax" /&gt;
          &lt;add namespace="System.Web.Mvc.Html" /&gt;
          &lt;add namespace="System.Web.Routing" /&gt;
          &lt;add namespace="System.Web.WebPages" /&gt;
        &lt;/namespaces&gt;
      &lt;/pages&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;modules&gt;
        &lt;remove name="FormsAuthenticationModule" /&gt;
      &lt;/modules&gt;
      &lt;staticContent&gt;
        &lt;remove fileExtension=".woff" /&gt;
        &lt;mimeMap fileExtension=".woff" mimeType="application/x-font-woff" /&gt;
      &lt;/staticContent&gt;
      &lt;handlers&gt;
        &lt;remove name="ExtensionlessUrlHandler-Integrated-4.0" /&gt;
        &lt;remove name="OPTIONSVerbHandler" /&gt;
        &lt;remove name="TRACEVerbHandler" /&gt;
        &lt;add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /&gt;
      &lt;/handlers&gt;
    &lt;/system.webServer&gt;
    &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt;
        &lt;parameters&gt;
          &lt;parameter value="v11.0" /&gt;
        &lt;/parameters&gt;
      &lt;/defaultConnectionFactory&gt;
      &lt;providers&gt;
        &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /&gt;
      &lt;/providers&gt;
    &lt;/entityFramework&gt;
    &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31BF3856AD364E35" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" /&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
  &lt;/configuration&gt;
  </code></pre>