title: How to automatically create a folder in the output folder with MSBuild?
body: <p>I am using VS Code and Net Core 1.1.1</p>
  
  <p>I need to create a folder named "Database" inside my output directory at building time. This is the folder where I want the sqlite database to be stored after creation.</p>
  
  <p>I already copy files into the output folder like this:</p>
  
  <pre><code>&lt;ItemGroup&gt;
      &lt;Content Include="appsettings.json"&gt;
       &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
      &lt;/Content&gt;
      &lt;Content Include="Data\\Seed\\Countries.csv"&gt;
       &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
      &lt;/Content&gt;
  &lt;/ItemGroup&gt;
  </code></pre>
  
  <p>How should I modify the .csproj file to automatically create the folder I need in my output direcory?</p>
  
  <p>As suggested in <a href="https://stackoverflow.com/questions/7849283/create-folder-inside-debug-or-release-con-console-application">this</a> old question, I tried to add the following code but the folder is not created.</p>
  
  <pre><code>&lt;Target Name="efcore"&gt;
      &lt;MakeDir Directories="$(OutDir)Database" Condition="!Exists('$(OutDir)Database')" /&gt;
  &lt;/Target&gt;
  </code></pre>