public DiagnosticsConfiguration LoadConfiguration()
        {
            var environmentName = (string)null;

            if (!RequestedEnvironmentName.IsNullOrEmpty())
            {
                environmentName = RequestedEnvironmentName;
            }
            else
            {
                //if (!TryDetectEnvironment(out environmentName))
                {
                    environmentName = "unspecified";
                    Diagnostics.Log.Warning(() => "Unable to detect environment in which this code is running. Loading environment-agnostic settings.");
                }
            }

            //# get default config from resource in this assemly
            var asm = Assembly.GetExecutingAssembly();
            var resourceName = @"SquaredInfinity.Diagnostics.Resources.Default_Configs.config.{0}.xml".FormatWith(environmentName);

            using (var configStream = asm.GetManifestResourceStream(resourceName))
            {
                using (StreamReader sr = new StreamReader(configStream))
                {
                    var configXml = sr.ReadToEnd();

                    var xmlConfigProvider = new XmlConfigurationProvider(configXml);

                    return xmlConfigProvider.LoadConfiguration();
                }
            }
        }
        public Entities.DiagnosticsConfiguration LoadConfiguration()
        {
            using(var xmlStream = ResourceAssembly.GetManifestResourceStream(ResourceName))
            {
                if (xmlStream == null)
                    throw new ArgumentException(
                        "Resource {0} cannot be found in assembly {1}"
                        .FormatWith(ResourceName, ResourceAssembly.FullName));

                var configXml = new StreamReader(xmlStream).ReadToEnd();

                var xmlConfigProvider = new XmlConfigurationProvider(configXml);

                return xmlConfigProvider.LoadConfiguration();
            }
        }
        public Entities.DiagnosticsConfiguration LoadConfiguration()
        {
            XmlConfigurationProvider xmlProvider = new XmlConfigurationProvider(File.ReadAllText(ConfigurationFilePath));

            return xmlProvider.LoadConfiguration();
        }