title: Automatically Include generated file in Visual Studio Project
body: <p>I'm writing an application that will enable the creation of SQL files within visual studio. The user will enter commands via the Package Manager console which will generate sql scrips and deposit them in a specific directory within the Visual Studio Project.</p>
  
  <p>The problem I have is that, when the files are generated, they are present on the file system, but not in Visual Studio. This is expected of course, as I need to then go and actively include the files within Solution explorer, but this isn't what I want. I want the files to "Magically" appear in solution explorer immediately after they're generated.</p>
  
  <p>I've seen various solutions to similar problems mostly featuring amendments to the .csproj file such as this</p>
  
  <pre><code>&lt;Compile Include="Sql\**\*.sql" /&gt;
  </code></pre>
  
  <p>but this isn't what i'm looking for. What i'm after is similar to how, for example, Entity Framework or MvcScaffolding work, where files / folders just magically drop into the project when commands run in PMC. I'm aware this runs off T4 templating, but that seems like too complex a solution for a simple issue like this.</p>
  
  <p>I should qualify that there's no voodoo going on in the creation of the files, just plain old File.Create() stuff.</p>
  
  <p>I'm open to any suggestions.</p>
  
  <p>Thanks.</p>