Visual Studio 2022 Can't Build Any Projects

7.9k views Asked by At

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

3

There are 3 answers

1
Caleb Seadon On BEST ANSWER

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

1
Leo Liu On

I have the same problem as you, since February 28th, VS2022 could not build any project, until today, I uninstalled the anti-virus software (360 Security Guard) installed on my computer, it returned to normal work, I think this is due to the anti-virus software update caused by the incompatible VS2022, You can try uninstalling the anti-virus software installed on your computer, which may solve the problem

0
David Castro On

You may not have access to the nuggets that are referenced in your solution, try that you have access to each of the nugget urls in your Edge/Chrome browsers

enter image description here