Getting this IsTestFileByName error upon msbuild. please help

csharp
sonarqube
msbuild

(r.kuma) #1

Hi out of nowhere, i am getting this error, when i am building my c-sharp solution with sonarqube. Without sonarqube , the solution builds without errors in visual-studio.

D:\Jenkins\workspace\second-    project\.sonarqube\bin\targets\SonarQube.Integration.targets(201,5): error MSB4018: The "IsTestFileByName" task failed unexpectedly. [D:\Jenkins\workspace\second-project\source\Logger\Logger.csproj]
D:\Jenkins\workspace\second-project\.sonarqube\bin\targets\SonarQube.Integration.targets(201,5): error MSB4018: System.IO.FileNotFoundException: D:\Jenkins\workspace\second-project\3rdparty\sonarqube\msbuild\SonarQube.Analysis.xml [D:\Jenkins\workspace\second-project\source\Logger\Logger.csproj]
D:\Jenkins\workspace\second-project\.sonarqube\bin\targets\SonarQube.Integration.targets(201,5): error MSB4018:    at SonarScanner.MSBuild.Common.Serializer.LoadModel[T](String fileName) [D:\Jenkins\workspace\second-project\source\Logger\Logger.csproj]
D:\Jenkins\workspace\second-project\.sonarqube\bin\targets\SonarQube.Integration.targets(201,5): error MSB4018:    at SonarScanner.MSBuild.Common.AnalysisProperties.Load(String fileName) [D:\Jenkins\workspace\second-project\source\Logger\Logger.csproj]
D:\Jenkins\workspace\second-project\.sonarqube\bin\targets\SonarQube.Integration.targets(201,5): error MSB4018:    at SonarScanner.MSBuild.Common.ConfigSettingsExtensions.GetAnalysisSettings(AnalysisConfig config, Boolean includeServerSettings) [D:\Jenkins\workspace\second-project\source\Logger\Logger.csproj]
D:\Jenkins\workspace\second-project\.sonarqube\bin\targets\SonarQube.Integration.targets(201,5): error MSB4018:    at SonarScanner.MSBuild.Tasks.IsTestFileByName.TryGetRegularExpression(AnalysisConfig config) [D:\Jenkins\workspace\second-project\source\Logger\Logger.csproj]
D:\Jenkins\workspace\second-project\.sonarqube\bin\targets\SonarQube.Integration.targets(201,5): error MSB4018:    at SonarScanner.MSBuild.Tasks.IsTestFileByName.Execute() [D:\Jenkins\workspace\second-project\source\Logger\Logger.csproj]
D:\Jenkins\workspace\second-project\.sonarqube\bin\targets\SonarQube.Integration.targets(201,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [D:\Jenkins\workspace\second-project\source\Logger\Logger.csproj]
D:\Jenkins\workspace\second-project\.sonarqube\bin\targets\SonarQube.Integration.targets(201,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [D:\Jenkins\workspace\second-project\source\Logger\Logger.csproj]
Done Building Project "D:\Jenkins\workspace\second-project\source\Logger\Logger.csproj" (default targets) -- FAILED.

please help.


(Valeri Hristov) #2

Hi @r.kumar,

Could you please add /d:sonar.verbose=true command line argument to the begin step of the Scanner for MSBuild and then send us the complete logs from both steps?

Edit: please, also make sure you are using the current versions of Scanner for MSBuild and Sonar C#.

Kind regards,
Valeri


(Raghavendra Rao Itikarlapalli) #3

Hi @Val,

I’m also getting the same exception hence added the verbose=true. Please find the below log steps
Logfile.txt (15.4 KB)


(r.kuma) #4

thanks, will try


(Andrei Epure) #5

Hi @Raghavendra_Rao_Itik

What is the command that you are running?

I see that the exception mentions there is no file found at C:\Windows\system32\config\systemprofile\.dotnet\tools\.store\dotnet-sonarscanner\4.5.0\dotnet-sonarscanner\4.5.0\tools\netcoreapp2.1\any\SonarQube.Analysis.xml . Could you double check the folder exists?