Bug with reading config file

Bug with reading config file

Hi,

I've had a problem with reading configuration file while NCoverExplorerConsole starting. In any case NCoverExplorer uses default config file.

I've looked to your code by reflector, and found a strange part of code:

public ConsoleOptions(string[] args) : base(args)
{
      this._configFileName = "";
      this._failIfBelowMinimum = false;
      this._minimumCoverage = 100f;
      this._projectName = "";
      this._reportType = ReportType.ModuleSummary;
      this._xmlReportFileName = "";
      this._htmlReportFileName = "";
      this._mergeFileName = "";
      this._showExcludedFooter = false;
      this._treeSort = "";
      this._treeSortStyle = TreeSortStyle.Name;
      this._treeFilter = "";
      this._treeFilterStyle = TreeFilterStyle.None;
      this._isNoLog = false;
      if (((args.Length == 0) || (args[0] == "/?")) || ((args[0].ToLower() == "/help") || !base.HasCoverageFileName))
      {
            this.Help();
      }
}

go to base class constructor:

public CommandLineOptions(string[] args)
{
      this._ParseStartupArguments(args);
}
where overridden method do the work
protected override void ValidateAndAssignArgument(string name, string value)
{
      switch (name.ToLower())
      {
            case "c":
            case "config":
                  this._configFileName = value;
                  return;
...
}

So, as I understand we validating and assigning command line arguments first in the base class, and than clean their values in ConsoleOptions constructor.

 

Thank you,

Pavel Cherezov