If a build server accidentally pushes a csharp analysis to a non-windows system, the c# files are ignored in analysis (without warning) and sonar history deletes them. It's not possible to delete the latest analysis in Sonar, so this is breaking the history until rescan on Windows has happened.
When running in debug mode, there is a warning about OS Incompatibility.
Sonar C# should either:
Expected behavior
Sonar C# should:
scan C# as good as possible
@jannylund, how do you manage to run a .Net analysis on a non-windows OS as the only way to execute a .Net analysis is thru the Scanner for MSBuild which can't be executed on non-windows machine ? Thanks
@fmallet previously sonar supported doing source-code-only analysis by using the sonar-runner/sonar-scanner command line tool. This was an easy way to get a quick overview of a legacy project before setting up the full build environment to run with sonar scanner.
Today, running somar-scanner on linux will still pull the C# rules from the server and then as mentioned in the ticket, kill the analysis history. If you don't support non-windows, please make it throw an ERROR and quit analysis.
@fmallet Just curious. JetBrains ported their ReSharper analysis engine to Mono and then became the core part of Rider IDE. MSBuild has been open sourced by Microsoft and is now able to run on non-Windows machines. So all the information seems to indicate the feasibility of running a scanner everywhere.
@lextm analysis IS possible on non-windows (e.g: MacOS). see this "beta" build that provides this basic support: https://github.com/SonarSource/sonar-scanner-msbuild/releases/tag/3.1-beta.1
I am currently trying to scan on my mac but it fails due to the "fix" done by this issue. If analysis can be performed on a mac, i believe the code changes for this commit should be reverted (or, at least, provide a matching "beta" release for the SonarC# plugin, from a different branch perhaps).
@liortal53 We decided to implement this "feature" to avoid weird and unexpected behaviors. We will obviously remove this as soon as we think we are ready with cross-platform support.
I understand that. but currently, it appears that even without full .net core support, it may be possible to analyze C# projects from a Mac. It was also suggested by someone on the open JIRA ticket (can't find the link now).
i'd like to have this support, even as an "experimental", "beta" or whatever other title it is you want to call that. alternatively, i can just comment out the code you added that tests for Windows OS, but i was unable to rebuild the plugin so i can't replace my version with a locally built version for testing purposes.
@jannylund @FastNinja @lextm @liortal53
Good news!
Early next week, we're going to release RC of the Scanner, SonarC# and SonarVB plugins that support scanning .NET Core project, not only on Windows but also on Linux and Mac.
Watch our for the release announcement. All feedback will be very appreciated and would help us to deliver the product to a highest quality.
Just to make it clear, since we are not using .net core - can we still use
this new support ? Or do you mean the scanner and plugins will be built on
top of .net core?
We are using c# (mono, with the unity3d engine).
On Nov 17, 2017 14:59, "michalb-sonar" notifications@github.com wrote:
@jannylund https://github.com/jannylund @FastNinja
https://github.com/fastninja @lextm https://github.com/lextm
@liortal53 https://github.com/liortal53
Good news!
Early next week, we're going to release RC of the Scanner, SonarC# and
SonarVB plugins that support scanning .NET Core project, not only on
Windows but also on Linux and Mac.Watch our for the release announcement. All feedback will be very
appreciated and would help us to deliver the product to a highest quality.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/SonarSource/sonar-csharp/issues/535#issuecomment-345237550,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAxVl7d2RwB6YIQzo44Ki_-9eJvbB4Sbks5s3YM6gaJpZM4OOUG3
.
@liortal53
Yes! You can analyze the .NET framework solutions with Mono.
We haven't tested unity3d specifically, so feedback here would be good.
Awesome. I will definitely play with it and give you feedback.
I already something when analyzing unity3d projects (even on windows).
What would be the best way to raise these issues? Via github issues or some
place else ?
On Nov 17, 2017 15:52, "michalb-sonar" notifications@github.com wrote:
@liortal53 https://github.com/liortal53
Yes! You can analyze the .NET framework solutions with Mono.We haven't tested unity3d specifically, so feedback here would be good.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/SonarSource/sonar-csharp/issues/535#issuecomment-345249065,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAxVly82JwxQfOkkS2Wp1KaEZVHXN3rYks5s3Y-OgaJpZM4OOUG3
.
Thanks! Yes, github issues would be the most convenient place.
But please open new issues (easier for us to handle) :)
Running into a similar issue...
OS: Ubuntu 18.04
Host: Appveyor
dotnet-sonarscanner: 4.4.2
dotnet-sdk: 2.1.500
java-jdk: 8
Any suggestions to fix this? script listed below image
(note: if i run the same code from my windows machine, it works fine)
(also note: code coverage works, but thats from my coverlet)

dotnet tool install --global dotnet-sonarscanner
dotnet test --filter "Category=Unit|Category=Integration" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
dotnet build-server shutdown
dotnet sonarscanner begin /k:$PROJECT /v:$VERSION /d:sonar.host.url=$SONAR_HOST /d:sonar.login=$SONAR_USER /d:sonar.password=$SONAR_PASS /d:sonar.cs.opencover.reportsPaths="test/*/coverage.opencover.xml"
dotnet build
dotnet sonarscanner end /d:sonar.login=admin /d:sonar.password=admin
Disregard, this is already taken care of in another thread.
Most helpful comment
Awesome. I will definitely play with it and give you feedback.
I already something when analyzing unity3d projects (even on windows).
What would be the best way to raise these issues? Via github issues or some
place else ?
On Nov 17, 2017 15:52, "michalb-sonar" notifications@github.com wrote: