title: MSBuild run XSD Task before files get compiled
body: <p>I'm pretty new to MSBuild and am trying to get an XSD Task to run so that the C# files I need to run my app will be refreshed each time we run a build. </p>
  
  <p>I've got the build task working like the following.</p>
  
  <pre><code>&lt;UsingTask TaskName="XSD" AssemblyName="Microsoft.Build.CppTasks.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/&gt;
  &lt;Target Name="GenerateCSFromXSD" BeforeTargets="Build"&gt;
    &lt;ItemGroup&gt;
      &lt;XSDInput Include="XML\File1.xsd"/&gt;
      &lt;XSDInput Include="XML\File2.xsd"/&gt;
    &lt;/ItemGroup&gt;
  
    &lt;XSD GenerateFromSchema="classes" Language="CS" Sources="@(XSDInput)" /&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>This works fine. Each time I run a build it will regenerate a new C# file for the File1 and File 2 inputs. My issue is that if I delete the File1 and File2.cs files from my repo, and run build, the build will fail because for some reason the files my XSD task is making are not generated at the time where it looks for my source files to compile. </p>
  
  <p>I thought that <code>BeforeTargets="Build"</code> would cause the files to be generated before it did anything else. Any ideas? I've also tried <code>BeforeTargets="Compile"</code></p>