Search code examples
c#androidvisual-studioxamarin.formside

Visual Studio 2022 not loading Android project


I am attempting to open a solution with 9 projects, inside a workspace on TFS, via VS 2022. I have tried using both VS 2022 Community 17.5.0 and VS 2022 Professional LTSC 17.4. Neither have that issue initially, but after some use, the problem manifests.

The solution has a Xamarin.Forms project targeting .net standard 2.0, and has an Android project upon which the solution load hangs. I've left this for many hours, but it seems to make no progress, staying in this state indefinitely:

The loading windows stays in this state indefinitely

Upon clicking on the VS taskbar I get the Windows Notification: "Visual Studio is busy - We'll automatically report this delay to Microsoft based on your Visual Studio Experience Improvement Program settings."

I can only manage to temporarily solve this issue by reinstalling VS. Repairing via the VS installer does not solve it. Neither does restarting VS or my laptop. Even reinstalling as a solution I am not too confident about due to the intermittentness of the issue. And that is not addressing the root cause.


Solution

  • Goto Tools->Options->Projects and Solutions->General and remove the tick at "Allow parallel project initialization"

    After disabling the parallel initialization of projects I could load the solution successfully multiple times. Enabling this feature brings back the problem.

    Addendum: This is NOT fixed in 17.5.2

    Addendum 2: Still under investigation - NOT fixed in 17.5.3

    Addendum 3: Microsoft has closed this as Fixed in 17.6 Preview 3

    (see https://developercommunity.visualstudio.com/t/VS2022-V175-hangs-when-loading-an-Andro/10292905?q=VS2022+17.5+hangs+when+loading+solution+with+Android+or+iOS+project)

    Addendum 4: Installed the Released Version of 17.6 today. Loading worked a few times, than hung again as before. Other reported this as well (see developer community link above).

    Addendum 5: This seems to be fixed in 17.7.0 Preview 6.0
    I was able to load the solution several times without a problem.

    Addendum 6: This is fixed in 17.7

    enter image description here