OK I have managed to fix the issue by changing the target framework to 4.5.2 (previously 4.6.1).