1

I have a lot of warnings when I run the MSBuild.SonarQube.Runner. They are in the format:

EXEC : warning : File is not under the project directory and cannot currently be analysed by SonarQube. File: [file], project [project]

I found the post about this problem. However the solution does not apply to my problem. There is no occurrence of Test anywhere in my path. I have been using SonarQube 5.1.2 and Sonar-MsBuild-Runner 1.0.1. In the hope so see an improvement, I tried Sonar-MsBuild-Runner 1.0.2-RC1. But unfortunately, I get the same messages in my build.

What can I do to resolve this?

Community
  • 1
  • 1
tobre
  • 1,347
  • 3
  • 21
  • 53
  • can you give more details on the layout of your project: from where do you analyze the project, etc. We need to understand why you are getting these warnings – Dinesh Bolkensteyn Nov 02 '15 at 09:03
  • We have all solutions (.sln) under [branch]\System\source.integration. The csproj files and all the source files would be under [branch]\System\source.implementation. – tobre Nov 02 '15 at 09:13
  • what is the path that is said to be outside of the project's directory? What is not yet supported is files that are shared among multiple projects of your solution. – Dinesh Bolkensteyn Nov 02 '15 at 10:17
  • It is not just one path. I count 325 of these messages. I could send you an email with the list, but would not want it published anywhere. – tobre Nov 02 '15 at 13:03
  • I'm sorry I won't be able to help you further unless you do some analysis of these messages by yourself. Another way forward would be to create a minimalistic reproducer project, that you could send here. But I won't be able to help you on a full scale project or to analyze complete logs. – Dinesh Bolkensteyn Nov 03 '15 at 15:28
  • 174 out of these 325 are shared files. – tobre Nov 04 '15 at 13:14
  • All the others are AssemblyAttribute.cs files that are in the AppData\Local\Temp directory. – tobre Nov 04 '15 at 13:46

1 Answers1

2

The analysis of shared files is not currently supported by the SonarQube Scanner for MSBuild, and I have created a ticket to consider adding that feature in a future version (at this stage though, it is not clear how this could be done technically) - https://jira.sonarsource.com/browse/SONARMSBRU-158

There indeed are also some similar warnings regarding temporary files generated by the .NET framework which can be safely ignored, but which still are noise that would be better to avoid in the first place. Ticket entered: https://jira.sonarsource.com/browse/SONARMSBRU-159

Dinesh Bolkensteyn
  • 2,971
  • 1
  • 17
  • 20
  • Thank you. I think this resolves it for now. Yes, the temporary generated files by the .NET framework should not be an important focus of the code analysis. If there are issues, Microsoft should take care of them. – tobre Nov 05 '15 at 18:09