title: Xamarin.Forms project fails to build in Azure Pipelines
body: <p>I have a Xamarin.Forms project for Android that I can build/test/deploy/package without any errors locally and the App runs fine on my phone. Perfect!</p>
  
  <p>Now I wanted to start using Azure DevOps Pipelines for CI, created a Xamarin Pipeline with the Wizard, started the Pipeline and it fails with a compilation error:</p>
  
  <pre><code>  /Users/vsts/agent/2.155.1/work/1/s/MyProject/MyService.cs(41,64): error CS1503: Argument 1: cannot convert from 'char' to 'string' [/Users/vsts/agent/2.155.1/work/1/s/MyProject/MyProject.Android.csproj]
  </code></pre>
  
  <p>Why does it build locally but not in the Pipeline? The referenced code in the error message is the following function:</p>
  
  <pre><code>var x = string.Join(',', nextStations);  // nextStations is IEnumerable&lt;string&gt;
  </code></pre>
  
  <p>I found out that the <code>string.Join(char, IEnumerable&lt;T&gt;)</code> function is only available in the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.string.join?view=netcore-2.2#System_String_Join__1_System_Char_System_Collections_Generic_IEnumerable___0__" rel="nofollow noreferrer">.NET Core Framework</a> but not in other versions like <a href="https://docs.microsoft.com/en-us/dotnet/api/system.string.join?view=xamarinandroid-7.1#System_String_Join__1_System_Char_System_Collections_Generic_IEnumerable___0__" rel="nofollow noreferrer">.NET for Xamarin.Android 7.1</a> - there is only a <code>string.Join(string, IEnumerable&lt;T&gt;)</code> function.</p>
  
  <p>Of course, I could now change all of my code to not using those functions only available in .net Core. Actually I tried this, but then the Azure Build failed because one of my referenced NuGet Packages is also using such a .Net Core-only string function so that linking the application failed in the Pipeline. So this is not a solution.</p>
  
  <p>So it seems that for whatever reason the Azure Pipeline tries to build my project against a different Framework. Why? Is there a way to configure this? Or is it a bug in Azure DevOps?
  Even when I take the msbuild command from the Pipelines log and execute it locally against my project, it runs without any errors. So why not in the pipeline?</p>
  
  <pre><code>msbuild /Users/vsts/agent/2.155.1/work/1/s/MyProject/MyProject.Android.csproj /t:PackageForAndroid /p:OutputPath=/Users/vsts/agent/2.155.1/work/1/b/Release /p:Configuration=Release
  </code></pre>
  
  <p>I guess this is the same problem as asked here: <a href="https://stackoverflow.com/questions/57493240/how-to-fix-error-processing-method-system-void-prism-navigation-pagenavigatio">How to fix &#39;Error processing method: &#39;System.Void Prism.Navigation.PageNavigationService&#39; error in Azure Pipelines</a> But that question doesn't have a real answer (switching to Debug doesn't solve it here) and I found out more details, i.e. the different Framework versions.</p>
  
  <p>So any idea how to make the Pipeline build the project?</p>
  
  <p>Visual Studio 2019, Xamarin.Forms 4.2.0.778463, Android Target Framework v9.0</p>
  
  <p>My azure-pipelines.yml file for reference:</p>
  
  <pre><code>trigger:
  - master
  
  pool:
    vmImage: 'macos-latest'
  
  variables:
    buildConfiguration: 'Release'
    outputDirectory: '$(build.binariesDirectory)/$(buildConfiguration)'
  
  steps:
  - task: NuGetToolInstaller@1
  
  - task: NuGetCommand@2
    inputs:
      restoreSolution: '**/*.sln'
  
  - task: XamarinAndroid@1
    inputs:
      projectFile: '**/*droid*.csproj'
      outputDirectory: '$(outputDirectory)'
      configuration: '$(buildConfiguration)'
  </code></pre>