1

I'm having a problem with failed build. Solution builds just fine by itself, but when I try to analyze and start with SonarQube.Scanner.MSBuild.exe begin my solution keeps failing with error

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1391,2): error : Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile? 
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1391,2): error : File name: 'Microsoft.Threading.Tasks.dll' 
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1391,2): error : at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) 
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1391,2): error : at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference)
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1391,2): error : at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel) 
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1391,2): error : at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver) 

There is project in the solution that uses Microsoft.Bcl.Async.1.0.168 NuGet package that contains Microsoft.Threading.Tasks.dll but I don't see where the version conflict would come from as sonar doesn't seem to (explicitly) contain the same library.

Any advice how to resolve the issue would be greatly appreciated

zura
  • 44
  • 6
  • 1
    Could you describe the steps you are using? I am asking because the Scanner for MSBuild is not a msbuild wrapper but only a pre and a post steps so it shouldn't have any impact on your build. – Amaury Levé Jun 30 '17 at 07:31
  • That's exactly the issue that I don't understand where this conflict is coming from. The steps are nothing different from the very basic example given in the documentation: SonarQube.Scanner.MSBuild.exe begin ... msbuild /t:Rebuild mysolution.sln and the build fails with above message. – zura Jul 01 '17 at 21:38
  • I get the same problem, had to spend few hours to understand SonarQube.MsBuild is the reason – Alex Sorokoletov Oct 19 '17 at 14:41

0 Answers0