In VS *.csproj file, I have 3 Itemgroup tags, Inside in 2nd tag I have update one more tag like below
<Res Include = "3" >
<Culture>fr</Culture>
</Res>
Using insertbefore method I can update above tag at ======location 1 ======
using $root.insertafter($a, $root,itemgroup.item(1))
but I want to add the tag at ======location 2 ======and getting error
for the same I am changing above code as $root.insertafter($a, $root,itemgroup.item(1).name)
can not convert itemgroup type string to system.xml.xmlnode
{I just want to add node at location 2 instead of location 1 }
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 1. <ItemGroup> <X= "Strings.fr.resources" > <Culture>fr</Culture> </X> <XX= "Dialogs.fr.resources" > <Culture>fr</Culture> </XX> </ItemGroup> ======location 1 don't want to add node here====== 2.<ItemGroup> ======location 2 just want to add node here======<Res Include = "1" > <Culture>fr</Culture> </Res> <Res Include = "2" > <Culture>fr</Culture> </Res> </ItemGroup> 3.<ItemGroup> <Res YY= "Strings.fr.resources" > <Culture>fr</Culture> </YY> <Res YY = "Dialogs.fr.resources" > <Culture>fr</Culture> </YY> </ItemGroup><projectgroup><projectdetails = "Strings.fr.resources" > <Culture>fr</Culture> </projectdetails> </projectgroup></Project>