Q:

Synchronize files between visual studio projects

I have two visual studio projects.  One is building for Windows, another for Linux and Mac.  They use exactly the same source files, but have different build configurations and link against two copies of the same library (one is built for Mono, the other for .NET).  
Here's a diagram:
    Folder structure:
      -- ProjectA
         -- ProjectA.csproj
         -- CustomSourceA.cs

      -- ProjectB
        -- ProjectB.csproj
        -- CustomSourceB.cs

      -- ProjectCore
        -- CommonFile1.cs
        -- CommonFile2.cs
        ...
  Reference Structure:
    ProjectA -> LibraryA (.NET)
    ProjectA -> Includes entire source code of ProjectCore
    ProjectB -> LibraryB (Mono, a complete source code rewrite of LibraryA)
    ProjectB -> Includes entire source code of ProjectCore

How do I synchronize these projects so that adding/removing files from one also adds/removes files from the other?  So far I've been manually doing this.  I have considered writing a script that just parses the XML and does it for me, but I'd like to know if there's a solution that doesn't involve this kind of manual hackery. 

A:

I ended up using a little trick to do this.  Replaced all includes in project B with a wild card:
  <!--  ProjectB.csproj -->
  <ItemGroup>
     <Compile Include="..\ProjectA\**\*.cs"/>
  </ItemGroup>

Then I added a compile flag to things in from project A that I didn't want in project B
//CustomSourceA.cs
#if PROJECT_A

#endif

