The project file could not be loaded. Data at the root level is invalid. Line 2, position 1 error in TeamCity

Whilst compiling a project locally on my development box (using Visual Studio 2015) everything was fine. However, as soon as I pushed my build up and TeamCity picked it up, TeamCity failed the build almost immediately. The error message wasn’t particuarly helpful. The project file could not be loaded. Data at the root level is[…]