Share via

Visual Studion 2022 Version 17.6 Hangs on Build\Clean\Rebuild All

samer.alisaleh 101 Reputation points
2023-05-23T12:41:55.2166667+00:00

Hi,

I have upgraded my Visual Studio 2022 to the latest version 17.6.1. Since then when I try to Run\Build project it hangs and I cant do anything to cancel the build except by ending VS from task manager. Please help. This is critical and I cant continue my development.

Thanks

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.


14 answers

Sort by: Most helpful
  1. Hamish 1 Reputation point
    2025-03-29T01:44:48+00:00

    I had this problem on a much later build. What solved it for me was deleting the global section out of the solution file. I figured this out after realizing VS was hanging at the IVsSolutionBuildManager5.FindActiveProjectCfgName(Guid, String) Method. This also explains why the build worked OK at command line; the solution was not being used by msbuild, only the root project. Maybe time to migrate to SLNX!

    0 comments No comments

  2. Mohammad Aldefrawy 0 Reputation points
    2023-12-07T17:57:31.1866667+00:00

    Only worked for me after deleting hidden folder .vs.

    0 comments No comments

  3. Coder Jax 0 Reputation points
    2023-11-17T08:42:56.9566667+00:00

    After logging into Windows and running VS, the first time I try to execute the build action I get the "Starting build..." message and then nothing, VS indicates it's "not responding", but if I leave it for a while (sometimes as long as 15 minutes), it actually does start building.

    Subsequent builds proceed normally without the unresponsive interval, and the problem won't recur unless Windows (11) is restarted.

    It's not ideal, but maybe try leaving VS for a bit longer before killing it via task manager until the issue is properly addressed.

    0 comments No comments

  4. Michael Mortensen 0 Reputation points
    2023-09-12T19:43:22.48+00:00

    This is very strange; all newer Visual Studio 2022 fails .. but from .NET SDK perspective, it is "only" version newer than 7.0.307 that fails with an infinite hang and 100% CPU usage.

    I am very curious to what Microsoft have done to break this.

    Tested versions (dotnet build):

    User's image

    global.json is not honored from Visual Studio - so unfortunately I cannot build my project from here.

    If anybody wants to test it out, feel free to do a:

    git clone https://github.com/gimlichael/Cuemon.git
    

    It is enough to try and build the Cuemon.Core project. Again, using dotnet build, it works flawlessly with any version prior or equal to 7.0.307. From 7.0.400 and forward it fails.

    Said mentioned project, Cuemon, will fail to build in any newer versions of Visual Studio (after June 30 this year).

    I am empty for ideas on how to fix this - so any help would be much appreciated.

    Thanks.

    UPDATE 1:

    If I use Resharper Build & Run, I can manually set the MSBuild to the one from .NET SDK within Visual Studio 2022. Just like dotnet build, this works with any version prior or equal to 7.0.307.

    UPDATE 2:

    Eureka! I have found the root cause; in Cuemon I have a class named Template (https://github.com/gimlichael/Cuemon/blob/development/src/Cuemon.Core/Template.cs).

    This class supports up to 20 generic parameters (yeah, I know - who would really want to use that many - but that is beside the point).

    After .NET SDK 7.0.307, Microsoft has made a change to MSBuild/dotnet that triggers the infinite build.

    I will see if I can make a GitHub issue - though I am in doubt where.

    My best guess would be .NET SDK if such exists - otherwise somewhere in the dotnet organization.

    For those of you experiencing same issue; it MIGHT be because of extensive generic use - but who knows - there could be other compilation bugs introduced after said mentioned .NET SDK version.

    Happy coding!

    UPDATE 3:

    Created an issue on GitHub: https://github.com/dotnet/sdk/issues/35365

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.