title: Why is AppDomain.CurrentDomain.BaseDirectory targeting bin catelog in console application?
body: <p>I have a console application. And in this application I have created a class libarary project which i reference in the main project. In this class library i have a file which I am trying to get. the code for this:</p>
  
  <pre><code>public static string GetPath(string fileName)
  {
      char separator = Path.DirectorySeparatorChar;
      string startupPath = AppDomain.CurrentDomain.BaseDirectory;
      string[] pathItems = startupPath.Split(separator);
      string projectPath = string.Join(separator.ToString(),
          pathItems.Take(pathItems.Length - 1)) + ".Handler";
      string path = Path.Combine(projectPath, "WebRequestHandlers\\Files" + separator + fileName);
  
      return path;
  }
  </code></pre>
  
  <p>I have used this in .net web project before and it has worked but for some reason this is my AppDomain.CurrentDomain.BaseDirectory:</p>
  
  <blockquote>
    <p>C:\projects\OverWatchServerCall\OverWatchServerCall\bin\Debug\</p>
  </blockquote>
  
  <p>It should be:</p>
  
  <blockquote>
    <p>C:\projects\OverWatchServerCall\OverWatchServerCall\</p>
  </blockquote>
  
  <p>The file is in the classlibrary project and as I said before this works fine in .net web api projects</p>
  
  <p>Why is this happening?</p>
  
  <p>EDIT:</p>
  
  <pre><code>Directory.GetCurrentDirectory()
  </code></pre>
  
  <p>Returns the same path</p>