title: How to have an optional file that gets copied to the output directory in VS 2017?
body: <p>On a large (team and code) project, we have set up the various <code>App.config</code>s and <code>Web.config</code>s to reference an (optional) <code>local.config</code> file so that developers can override some things when running locally. <code>local.config</code> is listed in <code>.getignore</code> so it's ignored and not included in commits. This works very well to support local configuration overrides.</p>
  
  <p>However, for console apps, <code>local.config</code> isn't copied to the output directory by default. I can set its properties in VS so that it's copied to the output - it gets listed in the <code>.csproj</code> file like this:</p>
  
  <pre><code>&lt;None Include="local.config"&gt;
      &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
  &lt;/None&gt;
  </code></pre>
  
  <p>This works fine in VS, even when a particular developer does not have a <code>local.config</code> file at all. However, it fails in the VSTS build jobs because apparently msbuild doesn't like it when a listed file is absent.</p>
  
  <p>Is there any way to configure the project or msbuild so that it will tolerate/ignore the missing (optional) file instead of failing the builds?</p>