おっさんプログラマーの備忘録

.NET系を中心に、主に備忘録として書いていきます

Visual Studio for Macのソリューションエクスプローラにてファイルが重複表示される

Windowsで作成したソリューションをMacVisual Studioで開いたら
SPA(Angular5)のプロジェクトのファイルが重複表示されたお話。

環境

現象

↓こんな感じです。
f:id:mct-gear:20180705175215p:plain

解決方法

csprojファイルのDon't publish ~ってコメント箇所に以下を追加

<None Remove="$(SpaRoot)**" />

具体的にはこんな感じです。

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

無事、解消されました。
f:id:mct-gear:20180705175725p:plain

参考サイト

stackoverflow.com