You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a test project that uses classes that are generated by a source generator
Make sure sonar.dotnet.excludeTestProjects is set to true
call begin step
call dotnet build -> this will fail because the source generator was removed by the GetAnalyzerSettings, so the generated type is not generated and is unknown in the test project.
Version used:
dotnet-sonarscanner 5.11.0
The text was updated successfully, but these errors were encountered:
csaba-sagi-sonarsource
changed the title
The GetAnalyzerSettings task is removing existing source generators for test projects when sonar.dotnet.excludeTestProjects is set to true
The GetAnalyzerSettings task is removing existing source generators for test projects when sonar.dotnet.excludeTestProjects is set to true
Feb 20, 2023
We run into the similar issue: If we use sonar, generator output is not present in the compiled dll. Any plans to fix it, or is there any workarounds? But in our case it is independent of setting. We use version 5.15 for dotnet-sonarscanner and server Version 8.3.1
The issue was originally reported by the community: https://community.sonarsource.com/t/sonarqube-scanner-seems-to-interfere-with-net-source-generators-refit/82712
Reproduction steps
sonar.dotnet.excludeTestProjects
is set totrue
begin
stepdotnet build
-> this will fail because the source generator was removed by the GetAnalyzerSettings, so the generated type is not generated and is unknown in the test project.Version used:
dotnet-sonarscanner 5.11.0
The text was updated successfully, but these errors were encountered: