private void WriteRuntimeConfiguration()
 {
     using (var stream = File.OpenRead(_source))
     {
         var parser = new DefaultConfigurationParser(Encoding.UTF8);
         string contents = parser.Parse(stream, new JsonSettingsProvider(_log, _options.ConigurationFilePath).Load());
         stream.Close();
         File.Delete(_dest);
         File.WriteAllText(_dest, contents);
         _log.WriteMessage($"Generated runtime configuration in {_dest}");
     }
 }
 private void WriteEnvironmentConfigurations()
 {
     foreach (var environment in new JsonSettingsProvider(_log, _options.ConigurationFilePath).LoadAllEnvironments())
     {
         using (var stream = File.OpenRead(_source))
         {
             var parser = new DefaultConfigurationParser(Encoding.UTF8);
             string contents = parser.Parse(stream, environment.Value);
             stream.Close();
             var output = $"{_dest}.{environment.Key.ToLower()}";
             File.WriteAllText(output, contents);
             _log.WriteMessage($"Generated {environment.Key} configuration in {output}");
         }
     }
 }