title: How to retrieve the path where the Project folder exists in C#?
body: <pre><code>public static void ReadingExcelSheetData()
  {
      Console.WriteLine("GetCurrentDirectory Returns :" + System.IO.Directory.GetCurrentDirectory());
      Console.ReadLine();
      controller = new XlsReader(System.IO.Directory.GetCurrentDirectory() + "\\TestCode\\Config\\controller.xls");
      testData = new XlsReader(System.IO.Directory.GetCurrentDirectory() + "\\TestCode\\Config\\testData.xls");
  }
  
  public static void  Main()
  {
          ReadingExcelSheetData();
          Console.ReadLine();
  }
  </code></pre>
  
  <p>Here System.IO.Directory.GetCurrentDirectory() returns E:\seleniumwith C#\myprojectsC#\Pluralsite\TestCode\TestCode\bin\Debug.</p>
  
  <p>But we have our controller sheet at E:\seleniumwith C#\myprojectsC#\Pluralsite\TestCode\TestCode\Config  location.</p>
  
  <p>I just want the path upto E:\seleniumwith C#\myprojectsC#\Pluralsite\TestCode\TestCode.
  How to get that. Can someone please help me out.</p>
  
  <p>Thanks,
  Nilanjan.<img src="https://i.stack.imgur.com/5mhPB.png" alt="enter image description here"></p>