Duplicate client-side files in solution explorer with Visual Studio for Mac

I had the following in my .csproj file, removing it fixed for me:

<ItemGroup>
    <None Include="**/*" />
</ItemGroup>

I was able to solve this by moving the folder ClientApp out of the project directory, then deleting it from the project. I then moved it back and included it in the project again, this time the files were no longer duplicated.


The problem is that there are duplicate None items defined by the Angular project file. Visual Studio for Mac will not hide these duplicate items, unlike Visual Studio on Windows.

If you edit the .csproj file and add <None Remove="$(SpaRoot)**" /> then the duplicate files will not be shown in the Solution window in Visual Studio for Mac.

<ItemGroup>
  <!-- Don't publish the SPA source files, but do show them in the project files list -->
  <Content Remove="$(SpaRoot)**" />
  <None Remove="$(SpaRoot)**" /> <!-- This has been added -->
  <None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
</ItemGroup>

In the above ItemGroup only the Content items were removed from the SpaRoot directory which is the ClientApp folder.