CSC : error CS0006: Metadata file error during Sonar Scan

Versions used

error observed*
CSC : error CS0006: Metadata file ‘/tmp/.sonarqube/resources/2/analyzers/dotnet/cs/StyleCop.Analyzers.dll’ could not be found

steps to reproduce

  1. Using RoslynPluginGenerator, created a plugin for the StyleCop.Analyzers nuget package
  2. Placed the plugin into SonarQube and restarted SonarQube
  3. Ran a build against a C# .NET Core project which used the plugin and ran on a Linux build server
  4. Received the error above even though the files existed

potential workaround

  1. Disabled the SonarQube plug-in, but used the nuget package as a Code Analyzer inside the build process and the code analyzer worked fine even on a Linux machine

Do you know of others who have successfully used the RoslynPluginGenerator and run on a Linux hosted agent within Azure DevOps?

You might want to try regenerating your plugin using a modified version of the SDK Roslyn Plugin generator created by this issue. I haven’t had the chance to try it, but it sounds like a similar issue.