Source/NFX/ApplicationModel/CommonApplicationLogic.cs
/// <summary>
/// Tries to find a configuration file name looping through various supported estensions
/// </summary>
/// <returns>File name that exists or empty string</returns>
Tries to find a configuration file name looping through various supported estensions
Tries to find a configuration file name looping through various supported estensions
public static string GetDefaultEntryPointConfigFileName()
      {
          var exeName = System.Reflection.Assembly.GetEntryAssembly().Location;
          var exeNameWoExt = Path.Combine(Path.GetDirectoryName(exeName), Path.GetFileNameWithoutExtension(exeName));
          var extensions = Configuration.AllSupportedFormats.Select(fmt => '.'+fmt);
          foreach(var ext in extensions)
          {
             var configFile = exeName + ext;
             if (File.Exists(configFile)) return configFile;
             configFile = exeNameWoExt + ext;
             if (File.Exists(configFile)) return configFile;
          }
          return string.Empty;
      }
public static string GetDefaultEntryPointConfigFileName ( ) { var exeName = System . Reflection . Assembly . GetEntryAssembly ( ) . Location ; var exeNameWoExt = Path . Combine ( Path . GetDirectoryName ( exeName ) , Path . GetFileNameWithoutExtension ( exeName ) ) ; var extensions = Configuration . AllSupportedFormats . Select ( fmt => ' ' + fmt ) ; foreach ( var ext in extensions ) { var configFile = exeName + ext ; if ( File . Exists ( configFile ) ) return configFile ; configFile = exeNameWoExt + ext ; if ( File . Exists ( configFile ) ) return configFile ; } return string . Empty ; }
Tries to find a configuration file name looping through various supported estensions
Tries to find a configuration file name looping through various supported estensions
//Console.WriteLine("EXENAME:" +exeName); //Console.WriteLine("EXENAME wo extension:" +exeNameWoExt); //Console.WriteLine("Probing:" +configFile); //Console.WriteLine("Probing:" +configFile);
File name that exists or empty string
File name that exists or empty string