could we add a bit of information under .NET specifying the msbuild option in the Prepare task versus “standalone scanner” for dotnet (.NET Core SDK) based builds? This would eliminate a lot of confusion for some developers. As it stands, the extension doesn’t seem to warn users that the they might want to use the standalone scanner because the .NET Core Build task is being used instead of the MSBuild task and therefore shouldn’t be using the msbuild option.
Otherwise, the Prepare and Analysis steps will certainly try, but users will see many strange errors…most stemming around dependencies and ambiguous references because msbuild is getting confused.
Hello @kirkpabk, thanks for the feedback, I would like to better understand your suggestion.
Are you using a standalone scanner instead of MSBuild option in Prepare task when building with .Net Core Build task, does it work on your side? I am asking because standalone scanner is not supposed to be running with C# and you should see a warning:
WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see SonarScanner for .NET
As of now, MSBuild is the only option that we support for both .NET Core Build task and MSBuild task. With this option enabled we run dotnet scanner (on linux and macos) or “classic” SonarScanner.MSBuild.exe (windows).