I am trying to add and delete elements from a C# .csproj file. The file, in part, appears below. Can someone show me how I can do the following two things?
- Add an element as shown below (the line that says, "I want to add this")
- Delete an element. For example, say I wanted to delete the line I have indicated below.
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> </PropertyGroup> <ItemGroup> <Reference Include="System.Data" /> <Reference Include="System.Deployment" /> </ItemGroup> <ItemGroup> <Compile Include="Generate\DatabaseContext.cs" /> <Compile Include="Generate\EntityClasses.cs" /> <Compile Include="Generate\Extensions.cs" /> <Compile Include="Schema\Column.cs" /> <Compile Include="Schema\EntityRef.cs" /> <Compile Include="SerializedData\Tables.xml" /> //I want to add this </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>