HttpContext.Current.IsDebuggingEnabled is always true

Why is my site running in debug mode?

HttpContext.Current.IsDebuggingEnabled is always true!

Ligaments do not work!

Although #if DEBUG is false, therefore DEBUG is undefined!

Precompilation is included in the appharbor application.

In my Web.Release.config, I delete debug:

<system.web> <compilation xdt:Transform="RemoveAttributes(debug)" /> </system.web> 

The online translation tester gives me this result, tested with my Web.config and Web.Release.config:

 <?xml version="1.0"?> <!-- Para obtener más información sobre cómo configurar la aplicación de ASP.NET, visite http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> </configSections> <connectionStrings> <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" /> <add name="StorageConnectionString" connectionString="UseDevelopmentStorage=true" /> </connectionStrings> <appSettings> <add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Enabled" value="false" /> <add key="ClientValidationEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" /> <add key="TwitterKey" value="{TwitterKey}" /> <add key="TwitterSecret" value="{TwitterSecret}" /> <add key="FacebookKey" value="{FacebookKey}" /> <add key="FacebookSecret" value="{FacebookSecret}" /> <add key="MicrosoftKey" value="{MicrosoftKey}" /> <add key="MicrosoftSecret" value="{MicrosoftSecret}" /> <add key="AnalyticsCode" value="{AnalyticsCode}" /> <add key="AnalyticsDomain" value="{AnalyticsDomain}" /> <add key="CrawlerServiceApiId" value="{CrawlerServiceApiId}" /> <add key="CrawlerServiceApplication" value="{CrawlerServiceApplication}" /> <add key="CrawlerServiceEndPoint" value="{CrawlerServiceEndPoint}" /> <add key="EmailServer" value="{EmailServer}" /> <add key="EmailUser" value="{EmailUser}" /> <add key="EmailPassword" value="{EmailPassword}" /> </appSettings> <system.web> <authentication mode="None" /> <compilation targetFramework="4.5.1" /> <httpRuntime targetFramework="4.5.1" /> <pages> <namespaces> <add namespace="System.Web.Helpers" /> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> <add namespace="System.Web.WebPages" /> </namespaces> </pages> </system.web> <system.webServer> <modules> <remove name="FormsAuthenticationModule" /> </modules> <staticContent> <remove fileExtension=".woff" /> <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" /> </staticContent> <handlers> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <remove name="OPTIONSVerbHandler" /> <remove name="TRACEVerbHandler" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> </handlers> </system.webServer> <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <parameters> <parameter value="v11.0" /> </parameters> </defaultConnectionFactory> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31BF3856AD364E35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration> = "Data Source = 9831a429-a608-4055-8bb9-a2bb016f79a3.sqlserver.sequelizer.com; Initial Catalog = db9831a429a60840558bb9a2bb016f79a3; user id = wgomqcwgmezvqifh; password = JqgJKAdNmPvR6ZSwsVJYZtP7VYE2pZaTmn6Mntozm4r8TjtMAEFZRwzqHhVT4kxu; MultipleActiveResultSets = True;" <?xml version="1.0"?> <!-- Para obtener más información sobre cómo configurar la aplicación de ASP.NET, visite http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> </configSections> <connectionStrings> <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" /> <add name="StorageConnectionString" connectionString="UseDevelopmentStorage=true" /> </connectionStrings> <appSettings> <add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Enabled" value="false" /> <add key="ClientValidationEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" /> <add key="TwitterKey" value="{TwitterKey}" /> <add key="TwitterSecret" value="{TwitterSecret}" /> <add key="FacebookKey" value="{FacebookKey}" /> <add key="FacebookSecret" value="{FacebookSecret}" /> <add key="MicrosoftKey" value="{MicrosoftKey}" /> <add key="MicrosoftSecret" value="{MicrosoftSecret}" /> <add key="AnalyticsCode" value="{AnalyticsCode}" /> <add key="AnalyticsDomain" value="{AnalyticsDomain}" /> <add key="CrawlerServiceApiId" value="{CrawlerServiceApiId}" /> <add key="CrawlerServiceApplication" value="{CrawlerServiceApplication}" /> <add key="CrawlerServiceEndPoint" value="{CrawlerServiceEndPoint}" /> <add key="EmailServer" value="{EmailServer}" /> <add key="EmailUser" value="{EmailUser}" /> <add key="EmailPassword" value="{EmailPassword}" /> </appSettings> <system.web> <authentication mode="None" /> <compilation targetFramework="4.5.1" /> <httpRuntime targetFramework="4.5.1" /> <pages> <namespaces> <add namespace="System.Web.Helpers" /> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> <add namespace="System.Web.WebPages" /> </namespaces> </pages> </system.web> <system.webServer> <modules> <remove name="FormsAuthenticationModule" /> </modules> <staticContent> <remove fileExtension=".woff" /> <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" /> </staticContent> <handlers> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <remove name="OPTIONSVerbHandler" /> <remove name="TRACEVerbHandler" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> </handlers> </system.webServer> <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <parameters> <parameter value="v11.0" /> </parameters> </defaultConnectionFactory> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31BF3856AD364E35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration> 
+6
source share
1 answer

I have the same problem. Temporarily, I am using this workaround found at http://support.appharbor.com/kb/getting-started/managing-environments .

 <add key="Environment" value="Debug"/> 

Appharbor will replace value = "Debugging" with the environment that was installed in AppHarbor https://appharbor.com/applications/ {appname} / edit

.

Instead of checking for HttpContext.IsDebugingEnabled, I will check

 var isInDebugMode = ConfigurationManager.AppSettings["Environment"].Equals("Debug", StringComparison.InvariantCultureIgnoreCase)); 
0
source

All Articles