SonarQube for Visual Studio plugin version: 9.0.0.15771
Programming language you’re coding in: C#/JS
Is connected mode used:
Disconnected IDE plugin.
And a thorough description of the problem / question:
I was using SonarQube extension fine yesterday and working through the list of issues it was showing for the solution. Then suddenly I saw the list was no longer there, and I could not get it back.
I have tried reboots, removing and re-installing the extension. It still won’t show any issues.
Looking at the log I see entries like this:
[SLCore] File to analyze was not found in the file system: file:///C:/Users/myuser/source/repos/myproj/file.cs
But the path is 100% correct.
As I said, it was working fine until at some point yesterday afternoon then suddenly it completely stopped functioning.
I have noticed that it does still work for .cshtml files, but only ones that are currently open for editing in the IDE. It doesn’t work at all for .cs files though, open or not.
I finally noticed that version 9.0.0 was released just two days ago. On a hunch I removed SonarQube 9.0.0 and re-installed version 8.30.0 and it immediately started working again. I have now disabled automatic updates of the extension.
Thank you for reporting this issue with the C# analysis in the new SonarQube for Visual Studio extension v9.0.0. We appreciate you joining the community and providing detailed logs.
Well I have a new twist. Now I can’t uninstall version 9.0.0.15771 of the extension. When I attempt to do so it says it’s not installed, but in Visual Studio it says it is installed and running.
Here is the log for that.
The behavior where the IDE reports the extension is running but the uninstaller says it’s not installed often points to an underlying state synchronization problem within Visual Studio (VS) itself or the VS Marketplace component. This is unfortunately outside the direct control of our extension.
For a workaround, we suggest manually removing the extension, as this often resolves these conflicting states:
Manual Uninstallation: You can manually delete the extension files.
Close Visual Studio.
Navigate to the extensions folder for your specific VS version (it should be similar to %LocalAppData%\Microsoft\VisualStudio\<Visual Studio version>\Extensions\...).
Locate and delete the folder corresponding to the SonarQube extension.
Here is a similar community post on the Microsoft forum.
C# Analysis Issue
I have reviewed the logs, unfortunately there is no clear indicator for the root cause of the C# analysis failure in v9.0.0.
To help us narrow down the scope of the problem, could you please provide more details about the context where the issue occurs?
Scope: Is the C# analysis failing on all files and all projects, or is it limited to a specific project type (e.g., .NET Framework, .NET Core/5/6+, SDK-style project) or specific files?
Consistency of C# Failure: Is the C# analysis consistently failing (it never works, even after a restart or project reload) or is the issue intermittent (it works sometimes, but randomly stops working)?
Other Language Analysis: You mentioned you also work with other languages. Is the analysis for JavaScript (JS) or any other non-C# language (e.g., TypeScript, HTML) working successfully and consistently in this version?
IDE Configuration: Are you running a standard Visual Studio installation, or are there any non-standard configurations or security policies on your machine?
Any additional context you can provide about your project configuration will be helpful in replicating the issue on our end.
Thank you again for your patience and for continuing to work with us on this.
Hi. I’ll try the manual uninstall. As for your other questions:
Version 9 of the extension isn’t working for me for any .cs files in any project type. I have tried .Net Framework 4.8 and .Net 8 web and library projects.
.cshtml file analysis seems to still work fine in both.
It consistently doesn’t work for .cs files, with ‘File to analyze was not found in the file system’ logged in the output.
The only thing possibly non-standard is that I do not run Visual Studio as an administrator on my machine.
As for manual removal of the extension, there was no real information at that link, and deleting the folder the extension was installed in causes visual studio to crash on startup. I restored the folder and it’s working again but uninstalling the extension still doesn’t work.
I compared with another device that’s working and it looks like it’s some kind of git issue. My log finds git at:
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw64\bin\git.exe
and
C:\Users\cwdev\AppData\Local\Programs\Git\cmd\git.exe
It then fails to run a git command of some kind and seems to fall back to some kind of java git.
On a collage’s machine that works it only finds C:\Users\auser\AppData\Local\Programs\Git\cmd\git.exe and is happy. Also there’s a difference in git versions:
C:\Users\cwdev\AppData\Local\Programs\Git\cmd\git.exe –version
git version 2.42.0.windows.2
“C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw64\bin\git.exe” --version
git version 2.51.0.windows.2
On my colleague’s machine where it’s working:
C:\Users\auser\AppData\Local\Programs\Git\cmd\git.exe –version
git version 2.40.0.windows.1
Is the extension sensitive to the version of git it finds?
After removing ‘C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw64\bin’ from my system PATH I finally got 8.30 working again. 9.0.0 still doesn’t but I’m ignoring that for now.
Do you have any file exclusions defined? You can check in SonarQube > Solution Settings or SonarQube > Options > File Exclusions tab
Does analysis start working if you press Ctrl + S with an active C# file? This should normally force analysis again
The git command that was executed is definitely wrong, there is a bug, but you said you removed the other git from path and it started working again. Does that mean you don’t have the exception in the logs anymore?
It would be helpful if you checked 1) and 2) and then provided the full verbose logs from the beginning. This will allow us to better understand what’s going on.
I also deleted the contents of SLVS_SLOOP before this run in case previous runs were causing it, hence all the SQL logging.
After the last log entry the caret is just sitting flashing forever.
I must add that the shift from scanning a full solution automatically to only scanning individual files is a tremendous step back in usefulness and usability. Honestly I’m surprised version 9 was released with such a huge limitation compared to 8.