Visual Studio 2022 Can't Build Any Projects
Asked Answered
C

3

5

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

Commensurate answered 1/3, 2022 at 7:57 Comment(0)
C
8

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

Commensurate answered 2/3, 2022 at 0:29 Comment(1)
This was my solution as well, thank you. I had Symantec Endpoint Protection installed on my laptop, and removing it (they also updated my BIOS, but I doubt that would of fixed it) solved the issue. Key here is to check Application Events and if you have a bunch of errors for MSBuild.exe - then most likely that's your issue as well.Sadler
I
1

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

Infuse answered 2/3, 2022 at 1:42 Comment(1)
It's the anti virus that's not compatible here. Or is not configured to allow Visual Studio 2022 to run. Also remember that the purpose of Visual Studio is to create and change executable files. Something a virus scanner is supposed to prevent. When building applications additional allow-listing of processes and folders isn't uncommon.Implicative
B
0

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

Basso answered 19/5, 2023 at 21:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.