title: How to return the Visual Studio currently open soution directory
body: <p>I have a Visual Studio solution that comprises of several projects and are separated into different directories.</p>
  
  <p>In my C# or VB.NET code, I want to determine the base directory (or the directory that the solution is in).  </p>
  
  <p>A dirty solution would be to call the directory <code>parent.parent.parent</code> until I find a file *.sln, but I also have several solutions in other directories that I don't want to be returned.</p>
  
  <p>I am just wondering if there is a cleaner method, maybe part of <code>System.Diagnostics.Debugger</code> or similar?</p>
  
  <p>I look forward to your reply, thanks.</p>