diff --git a/src/Umbraco.Core/Configuration/GlobalSettings.cs b/src/Umbraco.Core/Configuration/GlobalSettings.cs index dc00fc41f0..2daa6466d6 100644 --- a/src/Umbraco.Core/Configuration/GlobalSettings.cs +++ b/src/Umbraco.Core/Configuration/GlobalSettings.cs @@ -4,6 +4,7 @@ using System.Configuration; using System.Linq; using System.Web; using System.Web.Configuration; +using System.Web.Hosting; using System.Web.Routing; using System.Xml; using System.Xml.Linq; @@ -331,7 +332,13 @@ namespace Umbraco.Core.Configuration { try { - return bool.Parse(ConfigurationManager.AppSettings["umbracoDebugMode"]); + if (HttpContext.Current != null) + { + return HttpContext.Current.IsDebuggingEnabled; + } + //go and get it from config directly + var section = ConfigurationManager.GetSection("system.web/compilation") as CompilationSection; + return section != null && section.Debug; } catch { diff --git a/src/Umbraco.Tests/App.config b/src/Umbraco.Tests/App.config index cfbefb6754..57b918dd06 100644 --- a/src/Umbraco.Tests/App.config +++ b/src/Umbraco.Tests/App.config @@ -15,7 +15,6 @@ - @@ -81,6 +80,7 @@ + diff --git a/src/Umbraco.Tests/GlobalSettingsTests.cs b/src/Umbraco.Tests/GlobalSettingsTests.cs index 0c86a20a77..fb1f14f72b 100644 --- a/src/Umbraco.Tests/GlobalSettingsTests.cs +++ b/src/Umbraco.Tests/GlobalSettingsTests.cs @@ -32,6 +32,12 @@ namespace Umbraco.Tests } + [Test] + public void Is_Debug_Mode() + { + Assert.That(Umbraco.Core.Configuration.GlobalSettings.DebugMode, Is.EqualTo(true)); + } + [Ignore] [Test] public void Is_Version_From_Assembly_Correct() diff --git a/src/Umbraco.Web.UI/config/ClientDependency.config b/src/Umbraco.Web.UI/config/ClientDependency.config index acd5d07260..6c1ff881cf 100644 --- a/src/Umbraco.Web.UI/config/ClientDependency.config +++ b/src/Umbraco.Web.UI/config/ClientDependency.config @@ -10,7 +10,7 @@ NOTES: * Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config * A new version will invalidate both client and server cache and create new persisted files --> - +