title: Trying to include a transformed App.config in a XAP file
body: <p>I have a Silverlight project with multiple configuration files, and am using the transformation approach shown here:</p>
  
  <p><a href="https://stackoverflow.com/questions/3004210/app-config-transformation-for-projects-which-are-not-web-projects-in-visual-studi/5109530#5109530">App.Config Transformation for projects which are not Web Projects in Visual Studio 2010?</a></p>
  
  <p>This approach doesn't work as-is for Silverlight projects though. I've re-written the MSBuild project to look like this:</p>
  
  <pre><code>&lt;ItemGroup&gt;
    &lt;None Include="App.config" /&gt;
    &lt;None Include="App.QABuild.config"&gt;
     &lt;DependentUpon&gt;App.config&lt;/DependentUpon&gt;
    &lt;/None&gt;
  &lt;/ItemGroup&gt;
  
  ....
  
  &lt;UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" /&gt;
  
  &lt;Target Name="BeforeCompile" Condition="Exists('App.$(Configuration).config')"&gt;
    &lt;!-- Generate transformed app config in the output directory --&gt;
    &lt;Message Importance="high" Text="Transforming 'App.$(Configuration).config' to output config file..." /&gt;
    &lt;TransformXml Source="App.config" Destination="$(OutputPath)App.config" Transform="App.$(Configuration).config" /&gt;
  
    &lt;ItemGroup&gt;
      &lt;Content Include="$(OutputPath)App.config" /&gt;
    &lt;/ItemGroup&gt;
  &lt;/Target&gt;
  
  &lt;Target Name="BeforeCompile" Condition="!Exists('App.$(Configuration).config')"&gt;
    &lt;Message Importance="high" Text="Using default 'App.config' as output config file..." /&gt;
    &lt;Copy SourceFiles="App.config" DestinationFiles="$(OutputPath)App.config" /&gt;
  
    &lt;ItemGroup&gt;
      &lt;Content Include="$(OutputPath)App.config" /&gt;
    &lt;/ItemGroup&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>This code generates the correct output file for the correct configuration, however it is never included in the XAP file, even though I am putting the output config into the Content item group. All I need to happen is for the output config to get included in the output XAP but I can't get this to happen.</p>
  
  <p>Can anyone tell me what I'm doing wrong? I'm not an MSBuild expert by any means!</p>