Every time I go to build any project in Visual Studio 2022, all I get in the buil output is:
Build started...
1>------ Build started: Project: ConsoleApp7, Configuration: Debug Any CPU ------
The example above is a simple default template for a .NET 6 Console app.
It never progresses any further than that, the CPU sits around 0-3%, and the build has to canceled. Nothing happens, there's no errors. Same thing happens if I clean, or rebuild.
That's the full output with MSBuild project build output verbosity set to "Diagnostic"
I have VS 2015, and VS 2019 installed on the same computer, can can build projects fine.
I've tried:
- Uninstall/reinstalling VS 2022
- Clearing the cache (https://errorhandlinginskills.wordpress.com/2018/07/28/how-to-clear-visual-studio-cache/)
- Adding/removing features from VS
- Rebooting the PC
- Restoring Nuget packages manually (right-click solution -> restore)
- Checking for VS updates
- Running the dotnet commands from Powershell (dotnet run/clean/build) all work fine
I just can't think where to go next with this. Any help or suggestions, would be greatly appreciated, maybe even some condolences at this point ;).
The problem turned out to be caused by Symantec Endpoint Protection. It's an antivirus software that seems to kill processes it doesn't trust, by injecting its own DLL and causing them to fault.
So whenever msbuild.exe was running, Symantec would kill it. To resolve it, our IT team needed to add a policy to allow msbuild.exe.
Strange VS didn't detect MSBuild.exe had died, it just say there indefinitely.
I found this in the Windows Event Viewer under Application Events: