Generally you have two issues - files that are in one type but not the other, and references that differ between the CF and FFx. These problems can be worked around with manual manipulation of the project files, but be forewarned that the VS IDE doesn't appreciate you mucking with these (it doesn't know it should reload the entire project when your configuration changes).
What you can do:
- start with a CF project (you can start with eitehr, but this is how we do it)
- Add a new configuration - call it "Desktop" or whatever you'd like
- Modify the CF solution so it's more obvious (named Debug CF or whatever)
- Open the project file (*.csproj) with a text editor. You'll find several ItemGroup nodes. The important piece here is that msbuild supports conditionals for this node.
So if you have a node for the project references that looks like this
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
You can modify it to
<ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'Desktop|AnyCPU' >
<Reference Include="System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />
</ItemGroup>
Note that you have to give it the full name here.
You then can similarly modify the ItemGroup nodes for file inclusion into each project.
Now you've done the easy part. Next you have to massage the PropertyGroup nodes.This is a matter of looking at the CF project file and the FFx project file and putting relevent nodes into conditional parents. Take specific note of things like ProjectTypeGuids and PlatformFamilyName.
All that said, we've found it to be less work to just maintain separate project files for the CF and FFx versions where we need overlap.