title: Starting ASP.NET Core from Visual Studio doesn't start from build folder
body: <p>When you start an ASP.NET Core project from Visual Studio (2017) it assumes the working directory is where the source code is located, not where the built files are actually placed.</p>
  
  <p>Which means that when I run my project it reads the config file from <code>C:\Path\To\My\Project\appsettings.json</code>, and not from <code>C:\Path\To\My\Project\bin\Debug\appsettings.json</code>.</p>
  
  <p>I can see that this is the case when I debug this code:</p>
  
  <pre><code>WebHost.CreateDefaultBuilder(args)
      .UseStartup&lt;Startup&gt;()
      .ConfigureAppConfiguration((context, config) =&gt; {
          config.SetBasePath(context.HostingEnvironment.ContentRootPath);
          config.AddJsonFile("appsettings.json", true, false);
      });
  </code></pre>
  
  <p>Where <code>ContentRootPath</code> points to the project folder, not where the built files are placed.</p>
  
  <p>I could probably fix this by setting the <code>Working Directory</code> in <code>Project Properties &gt; Debug</code>, but seeing as we're also using configuration transforms (SlowCheetah), each developer will have their own build configuration for debug output (<code>bin\Debug[CustomConfiguration]</code>), and changing <code>.csproj</code> for one developer breaks it for all the other developers.</p>
  
  <p>Is there any way of having ASP.NET Core read the config files from where the built files are placed instead of the project folder, without having to change the <code>Working Directory</code>, yet still working for multiple "Build Configurations"?</p>