Which versions are you using
- SonarQube 8.9 (build 43852)
- SonarScanner for MSBuild 5.0.4
What are you trying to achieve
We are trying to solve the following warnings from the SonarScanner:
- 11:54:11.528 11:54:11.528 WARNING: File ‘C:\Users\CIUser.nuget\packages\mstest.testadapter\2.2.4\build_common\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll’ is not located under the root directory ‘H:\workspace\SmartTranslator_nightly’ and will not be analyzed.
- 11:54:11.528 11:54:11.528 WARNING: File ‘C:\Users\CIUser.nuget\packages\mstest.testadapter\2.2.4\build_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll’ is not located under the root directory ‘H:\workspace\SmartTranslator_nightly’ and will not be analyzed.
- 11:54:11.528 11:54:11.528 WARNING: File ‘C:\Users\CIUser.nuget\packages\mstest.testadapter\2.2.4\build_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll’ is not located under the root directory ‘H:\workspace\SmartTranslator_nightly’ and will not be analyzed.
- 11:54:11.528 11:54:11.528 WARNING: File ‘C:\Users\CIUser.nuget\packages\mstest.testadapter\2.2.4\build\net45\Microsoft.TestPlatform.AdapterUtilities.dll’ is not located under the root directory ‘H:\workspace\SmartTranslator_nightly’ and will not be analyzed.
What have you tried so far to achieve this
Because the MSTest.TestAdapter package was outdated, we first tried to update it to the latest version, but nothing changed.
We found this File is not located under the root directory and will not be analyzed which is the same warning. We do not include the problematic files ourselves, but it gave us an idea. An inspection of the package revealed that the files are automatically included by the package. The includes are located in \build\net45\MSTest.TestAdapter.props.
Since this is done by the package itself, it does not look like we can fix it in our project. It seems more like an edge case which needs to be handled by the SonarScanner for MSBuild. Or the configuration of our test project is wrong, and it is not correctly recognized as a test project.