title: Mono:Could not load file or assembly 'System.Threading.Tasks.Dataflow'
body: <p>We are using <strong>C# Roslyn Version 2.3.1</strong> for opening <strong>.csproj</strong> projects programmatically.</p>
  
  <p>For this purpose, we are using the following standard API code provided by Roslyn for opening the .csproj and navigating through each <strong>Microsoft.CodeAnalysis.Document</strong> to get the syntax tree of the Document:  </p>
  
  <pre><code>public void BrowsProjectDocuments(string projectPath)
  {
     var workspace = MSBuildWorkspace.Create();
     workspace.WorkspaceFailed += WorkSpaceFailed;
     Project currentProject = workspace.OpenProjectAsync(projectPath).Result;    
  
     foreach(Document document in currentProject.Documents)
     {
          Task&lt;SyntaxTree&gt;  documentSyntaxTree = document.GetSyntaxTreeAsync();
          .....
          .....
     } 
  }
  
  private static void WorkSpaceFailed(object sender, WorkspaceDiagnosticEventArgs e)
  {
     Console.WriteLine(e.Diagnostic.Message);
  }
  </code></pre>
  
  <p>When we run the above code on <strong>Windows 7</strong> using <strong>.NET Framework 4.6.1/4.6.2</strong> and <strong>Roslyn 2.3.1</strong>, the code runs well and <strong>we get the required syntax tree of each Document</strong>.</p>
  
  <p>But when we try to run the same code on <strong>Ubuntu 16.04</strong>, <strong>currentProject.Documents</strong> returns <strong>0</strong> count and we get following error thrown in the <strong>WorkSpaceFailed</strong> event hooked up:</p>
  
  <blockquote>
    <p>Msbuild failed when processing the file
    '/home/user/CSharp/RoslynSamples/AplModel/AplModel.csproj'
    with message: 
    Could not load type of field
    'Microsoft.Build.BackEnd.Logging.LoggingService:_loggingQueue' (20)
    due to: Could not load file or assembly
    'System.Threading.Tasks.Dataflow, Version=4.5.24.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
    assembly:System.Threading.Tasks.Dataflow, Version=4.5.24.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type: member:</p>
  </blockquote>
  
  <p>We have installed mono on the Ubuntu machine using:</p>
  
  <blockquote>
    <p>sudo apt-get install mono-complete</p>
  </blockquote>
  
  <p>What are we missing?</p>