The first step is figuring out what the error actually is. In order to do this expand your MsBuild output to be diagnostic. This will reveal the actual command executed and hopefully the full error message as well
- Tools -> Options
- Projects and Solutions -> Build and Run
- Change “MsBuild project build output verbosity” to “Diagnostic”.