I want to manipulate a xml file. For example I want to add <Compile Include="Program2.cs" />
and delete <Compile Include="clsBlubb.cs" />
. I do not know exactly how to get the right Xml Element (ItemGroup) dynamically and how to add or delete an element.
It would be grateful if somebody can help me.
Example Xml:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="clsBlubb.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
</Project>