visual-studiocl

Visual Studio suddenly cannot compile any C++ projects, MSB6006 CL.exe exited with code -524284580


Have been using VS for many years on C++ and C# projects. When attempting a small modification to a C++ project it would no longer build. I have both VS2019 and 2022 professional installed, valid license.

First I thought it was related to my code. But soon found out that all C++ projects failed in both versions of VS.

Tried to create a simple one line hello world program; same result.

Upgraded VS2022 to latest version, no change.

Verbose error log does not give many clues, compiler fails before it even start on any of my own files. OS is Windows 11 Pro.

Error is: Severity Code Description Project File Line Suppression State Error MSB6006 "CL.exe" exited with code -524284580. Hello World C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 741


Solution

  • I discovered that I could run cl.exe successfully just after rebooting the computer, but after a minute or so it started to exit with error like before.

    This lead me to thinking it was blocked by some other task that was not started until after logon.

    My company uses Cylance Protect for blocking malware, and it was this application that blocked cl.exe and also VirtualBoxVM.exe that reported same error code -524284580 (0xE0C00D5C). I have now asked IT to safelist these two apps, and I'm pretty sure it will solve it.