I’m having a deadlock issue after installing the SonarLint extension in Visual Studio 2022.
Operating system: Windows 10
Visual Studio version: 17.10.6
SonarLint plugin version: 8.2.1.96841
Programming language you’re coding in: c#
Is connected mode used: Did not configure anything, so probably no.
And a thorough description of the problem / question:
Have a Visual Studio solution (from a Git repository) and having that solution as a pinned element in the Windows task bar, to directly open the solution in Visual Studio 2022.
Before closing the solution have some code files open and pin an open code document in Visual Studio. Close Visual Studio.
If now Visual Studio is opened directly with the solution (e.g. using the pinned element in the task bar), Visual Studio will encounter a deadlock while loading the file content.
Note that opening an empty Visual Studio and opening the solution from there works fine.
The callstacks of the deadlock show SonalLint accessing the “DaemonLogLevel” setting from a background thread and from the main UI thread of Visual Studio and seem to block each other. See both attached screenshots.
I, too, am facing this issue (repeatedly). So far, the only way to resolve it has been to force-delete the entire folder and re-pull it from git to get unblocked.
The issue looks like lock contention, where there’s a wait but it’s not been (and will never be) released.
VS 17.11.1
Sonarlint extensions 8.2.1.96841
C# Solution .NET 8.0
I have also the same problem. i have a solution bind to sonarcloud.
If i close Visual Studio solution with opened files, when i repoen the solution, Visual Studio is busy and the current file opened shows “Loading editor packages”
Hi @Karsten and thank you for reporting this problem
The issue seems strange and I’ve never encountered it in vs17.9, but one of my colleagues confirmed they had it in vs17.10, which matches your version. The code that is getting deadlocked has not changed for a very long time which is why the error is so surprising to me.
I will look into this and get back to you as soon as I have something concrete.
Small note: I don’t think the Run background code analysis setting should make any difference, as this setting only controls the execution of the roslyn analyzers. Those are run by VS and do not access the logging infrastructure of SonarLint, which is where the deadlock seems to happen.
I think I have found the issue with the Lazy settings initialization in our logger. Thank you so much for providing the callstacks, as I couldn’t reproduce this on my PC, and those were very helpful in identifying the problem.
To verify that we actually fixed the problem, could you please try this build and share your feedback in this thread?
I can also confirm, that the provided version of the extension no longer shows the behavior described in the issue. Opening solutions with or without pinned files works fine now.
Thank you.
Version 8.2.2.98119 has been released. Note, that the test build in this thread was of version 8.3, so you need to uninstall that, as VS doesn’t update to a lower version.