When trying to get a non-existing key an exception is thrown. The correct behaviour should be:
If a config flag "BreakOnNotFoundKeys" is true, it should throw an exception. If set to false it should return the default value.
Value cannot be null.
Parameter name: The configuration wasn't loaded correctly
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: The configuration wasn't loaded correctly
Source Error:
Line 10: public class LuneraConfiguration
Line 11: {
Line 12: public static bool EnableWebAPITracing { get { return DefaultConfiguration.GetAppSettingsValue("EnableTracing", false); } }
Line 13: }
Line 14: }
Source File: d:\Projects\Brad\Lunera\Code\WebAppCommon\LuneraConfiguration.cs Line: 12
Stack Trace:
[ArgumentNullException: Value cannot be null.
Parameter name: The configuration wasn't loaded correctly]
System.Extensions.ObjectChecker.IsNotNull(Object obj, String paramName, String message) +122
System.Extensions.DefaultConfiguration.GetAppSettingsValue(String key, T defaultValue) +98
[ConfigurationErrorsException: An error has ocurred while trying to obtain a key]
System.Extensions.DefaultConfiguration.HandleException(Exception e) +93
System.Extensions.DefaultConfiguration.GetAppSettingsValue(String key, T defaultValue) +310
WebAppCommon.LuneraConfiguration.get_EnableWebAPITracing() in d:\Projects\Brad\Lunera\Code\WebAppCommon\LuneraConfiguration.cs:12
LuneraAPI.WebApiConfig.Register(HttpConfiguration config) in d:\Projects\Brad\Lunera\Code\LuneraAPI\App_Start\WebApiConfig.cs:41
System.Web.Http.GlobalConfiguration.Configure(Action`1 configurationCallback) +124
LuneraAPI.WebApiApplication.Application_Start() in d:\Projects\Brad\Lunera\Code\LuneraAPI\Global.asax.cs:27
[HttpException (0x80004005): An error has ocurred while trying to obtain a key]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9937701
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): An error has ocurred while trying to obtain a key]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9951956
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254