Can't open plugin project in VS2017

I get the following error trying to load the Shared Code Project.

Cannot load project with duplicated project items: PluginEditor.cpp is included as 'ClCompile' and as 'ClCompile' item types.

Ok, I see what’s going on, if you have a .cpp file in a project twice, even if one of them is marked as ‘Don’t Compile’ the project won’t load in VS2017.