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
What I ended up doing was to remove all the files from the project that were affected, refreshed the solution explorer and showed all files including ones no longer in the project, and then re-included the files to the project.
The first time I tried I didn't refresh the solution explorer and it didn't change anything, but after refreshing and toggling show/hide all files a few times after removing them from the project, including them back only added a reference to them once instead of the twice that I was seeing.
What really made this quick was that I could select all the files I wanted to work with by using shift-click and ctrl-click and then right clicking to perform whatever action on them as a group, such as excluding from the project, including in the project, or changing the copy to output directory setting.