visual-studiovisual-studio-2022antivirussymantec

Visual Studio 2022 Can't Build Any Projects


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:

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 ;).


Solution

  • 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:

    enter image description here