MSB3721: The command 'command' exited with code 'error-code'

This error occurs when a command launched in the build process exits with a non-zero error code.

To investigate the error, check the build output or build log to see if the custom build step produced an error with information about the problem. If not, try running it separately to check for any problems or unexpected behavior.

If you can't see the exact command-line that failed, you can change the verbosity of the build output to show more detail. The MSBuild command-line option is -verbosity:{level} or -V:{level}, where {level} is one of q[uiet], m[inimal], n[ormal] (the default), d[etailed], or diag[nostic]. See MSBuild command line reference. For bigger output logs on large projects, consider using the binary log (-bl command-line switch) and the MSBuild Structured Log Viewer to view the output more easily.

You can also set the MSBuildDebugEngine environment variable to 1 to get all possible logs. See Building MSBuild for the .NET Framework - Logs.

In Visual Studio, you can change the verbosity in Tools > Options, Projects and Solutions, Build and Run. See How to: View, save, and configure build log files.