title: How to flatten an item out into a property?
body: <p>How does one flatten an item out into a property?</p>
  
  <p>According to this <a href="http://msdn.microsoft.com/en-us/library/dd997067.aspx" rel="nofollow">MSDN page (section <code>Conversions between Strings and Item Lists</code>)</a>, it is simply a matter of declaring a property with the item as the value.</p>
  
  <p>But I found actual practice to be completely contrary. When I run this project with MSBuild 4.0, specifying target <code>install</code> ...</p>
  
  <pre><code>&lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;Import Project="$(Project-to-import)" Condition="'$(Project-to-import)' != ''" /&gt;
  
    &lt;ItemGroup&gt;
      &lt;RuntimeProj    Include="C:\TEMP\Design.proj" /&gt;
      &lt;DesigntimeProj Include="C:\TEMP\Run.dproj" /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;PropertyGroup&gt; &lt;!-- Flatten out the items to properties. --&gt;
      &lt;RuntimeProj&gt;@(RuntimeProj)&lt;/RuntimeProj&gt;
       &lt;!-- ^ This bit doesn't work. MS documentation is wrong? --&gt;
      &lt;DesigntimeProj&gt;@(RuntimeProj)&lt;/DesigntimeProj&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;Target Name="install"&gt;
      &lt;Message Text="Hello world!"/&gt;
      &lt;MSBuild Projects="$(MSBuildProjectFile)" Targets="BuildRunPackage"   
               Properties="Project-to-import=$(RuntimeProj)" /&gt;
      &lt;MSBuild Projects="$(MSBuildProjectFile)" Targets="BuildDesignPackage"
               Properties="Project-to-import=$(DesigntimeProj)" /&gt;
    &lt;/Target&gt;
  
    &lt;Target Name="BuildRunPackage"&gt;
      &lt;CallTarget Targets="Clean" /&gt; 
      &lt;CallTarget Targets="Build" /&gt; 
    &lt;/Target&gt;
  
    &lt;Target Name="BuildDesignPackage"&gt;
      &lt;CallTarget Targets="Clean" /&gt; 
      &lt;CallTarget Targets="Make" /&gt; 
      &lt;CallTarget Targets="Register" /&gt;
    &lt;/Target&gt;
  &lt;.Project&gt;
  </code></pre>
  
  <p>... an error is returned ...</p>
  
  <blockquote>
    <blockquote>
      <p>error MSB4012: The expression "Project-to-import=@(RuntimeProj) cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists.</p>
    </blockquote>
  </blockquote>