We recently merged two branches of code and ended up with duplicate entries for several of the files in the .csproj file. This seemed to happen to all the files which needed the
I used rodrigoff's .ps1 file (thanks!) but I had to modify it for my project to compile because it did not search for all entries in the csproj file, it was searching only for Compile and Content i changed this line of code:
$entries = $xml.Project.ItemGroup.Compile + $xml.Project.ItemGroup.Content | Group-Object Include
to:
$entries = $xml.Project.ItemGroup.Compile + $xml.Project.ItemGroup.Content +$xml.Project.ItemGroup.Reference + $xml.Project.ItemGroup.EmbeddedResource + $xml.Project.ItemGroup.None + $xml.Project.ItemGroup.Page + $xml.Project.ItemGroup.Resource + $xml.Project.ItemGroup.ProjectReference + $xml.Project.ItemGroup.Folder | Group-Object Include