Share via


MSB6006 diagnostic code

This article describes the MSB6006 error code.

Message text

MSB6006: 'value' exited with code 'value'.

Description

This error occurs when a command is executed and returns a nonzero exit code, or otherwise indicates an error in its output.

Resolution

The standard output message text is followed by additional information from the operating system. Look to the additional information provided to determine the cause of the problem.

If logging is enabled in the build, the output might be written to the build log. For more information, see View, save, and configure build logs and Obtaining build logs with MSBuild.

To diagnose the error, first enable a diagnostic log by using the -verbosity:diag command-line switch, and then check the MSBuild log file with the full diagnostics output. For longer output logs on large projects, consider using the binary log -bl command-line switch with 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. For more information, see Building MSBuild for the .NET Framework - Logs.

It might be helpful to reproduce the error in isolation. Try running the tool separately with the same inputs and command-line arguments that MSBuild uses in the build. If symbols are available, and you have a Debug build of the tool, attach a debugger to the tool and debug the tool itself to check for the problem.

See Diagnose MSBuild task failures

Applies to

All versions of MSBuild