title: How to ensure there is trailing directory separator in paths?
body: <p>I'm having an issue with <code>AppDomain.CurrentDomain.BaseDirectory</code>.</p>
  <p>Sometimes the path ends with '', sometimes it doesn't and I can't find a reason for this.</p>
  <p>It would be fine if I was using <code>Path.Combine</code> but I want to do <code>Directory.GetParent</code> and it yields different results.</p>
  <p>My current solution is:</p>
  <pre><code>var baseDir = AppDomain.CurrentDomain.BaseDirectory;
  if (!baseDir.EndsWith(&quot;\\&quot;)) baseDir += &quot;\\&quot;;
  </code></pre>
  <p>Is there another way to get the parent directory of the application?</p>