Home

How to fix the error MSB6006: MT.EXE exited with code 31?

Alton Alexander
By Alton AlexanderUpdated on June 4th, 2022

The MSB6006 error code indicates that the MT.EXE process has exited with code 31. This error can occur for a variety of reasons, but is typically caused by an issue with the project configuration or the environment in which the build is being run. In some cases, it may also be caused by a corrupt or missing file.

1. Re-install Microsoft Visual Studio

  1. Download the Microsoft Visual Studio 2017 RC from microsoft.com/downloads.
  2. Unpack the Microsoft Visual Studio 2017 RC files to a local folder.
  3. Start Microsoft Visual Studio 2017 RC and click on the install button.
  4. When the installation process starts, click on the option to install the latest updates.
  5. After the updates are installed, click on the option to install Microsoft Visual Studio 2017.
  6. When the Microsoft Visual Studio 2017 installation process starts, click on the option to install Microsoft Visual Studio 2017 RC.
  7. After the Microsoft Visual Studio 2017 RC installation process is complete, click on the option to restart Microsoft Visual Studio 2017.
  8. When Microsoft Visual Studio 2017 restarts, click on the option to open Microsoft Visual Studio 2017.
  9. In the Microsoft Visual Studio 2017 window, click on the File menu and select the option to open Microsoft Visual Studio 2017 RC.
  10. In the Microsoft Visual Studio 2017 RC window, click on the option to open the project that was created when the Microsoft Visual Studio 2017 RC was installed.

2. Update Microsoft Visual Studio

  1. Open Microsoft Visual Studio.
  2. On the Tools menu, select Options.
  3. On the Options menu, select the Environment option.
  4. On the Environment tab, select the Microsoft Visual Studio Tools for Applications option.
  5. On the Version tab, select the check box next to Microsoft Visual Studio 2015.
  6. Click OK.
  7. On the File menu, select Exit.
  8. On the main menu, select Start.
  9. Select All Programs.
  10. Select Microsoft Visual Studio 2015.
  11. Select the Update component.
  12. On the Update component menu, select Check for Updates.
  13. On the Updates tab, select Search for Updates.
  14. On the Updates Search Results page, select Install.
  15. On the Install Updates page, select the check box next to Microsoft Visual Studio 2015.
  16. Click Install.
  17. On the Update Results page, review the updates that were installed.
  18. If there are any updates that were not installed, select Install again.
  19. Close Microsoft Visual Studio.

3. Repair Microsoft Visual Studio

  1. Open the Microsoft Visual Studio installation folder.
  2. Open the "setup.exe" file.
  3. Follow the on-screen instructions.
  4. Repair the Microsoft Visual Studio installation.

4. Uninstall and reinstall Microsoft Visual Studio

  1. Close all Microsoft Visual Studio instances.
  2. Delete the msb6006mt.exe file from your system.
  3. Download and install the latest version of Microsoft Visual Studio.
  4. Open Microsoft Visual Studio and follow the installation wizard.
  5. When the installation is complete, open msb6006mt.exe and click the Uninstall button.
  6. Restart your computer.
  7. Install the latest version of Microsoft Visual Studio.
  8. Open msb6006mt.exe and click the Reinstall button.
  9. Follow the installation wizard.
  10. When the installation is complete, open msb6006mt.exe and click the OK button.

5. Delete the mt.exe file and re-download it

  1. Open Command Prompt as administrator
  2. Change directory to the location where mt.exe is installed
  3. Type the following command and press Enter: cd C:\Program Files (x86)\Microsoft Visual Studio\Common7\IDE
  4. Type the following command and press Enter: rmdir mt.exe
  5. Type the following command and press Enter: reload mt.exe

6. Copy the mt.exe file from another computer

  1. Locate the mt.exe file on the computer that is experiencing the error.
  2. Right-click on the mt.exe file and select "Copy".
  3. Paste the copied mt.exe file into the same location on the computer that is experiencing the error.
  4. Double-click on the mt.exe file to run it.

If you didn't find success with an option above, then try:

  1. Run the mt.exe file as an administrator