Open
Description
Input (whitespace in the itemgroup is garbled on purpose):
<!-- comment -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- comment -->
<ItemGroup>
<i Include="a">
<!-- comment -->
<m>metadata value</m>
</i>
</ItemGroup>
</Project>
Action:
projectRootElement.AddProperty("P", "v");
Actual Output. The comment above the itemgroup is separated from the itemgroup, and no trailing whitespace is added after the propertygroup:
<!-- comment -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- comment -->
<PropertyGroup>
<P>v</P>
</PropertyGroup>
<ItemGroup>
<i Include="a">
<!-- comment -->
<m>metadata value</m>
</i>
</ItemGroup>
</Project>
Desired Output:
<!-- comment -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<P>v</P>
</PropertyGroup>
<!-- comment -->
<ItemGroup>
<i Include="a">
<!-- comment -->
<m>metadata value</m>
</i>
</ItemGroup>
</Project>