title: Get type information for type declared in another assembly/project
body: <p>So as the title says I'm trying to get type information from types declared in another assembly using Roslyn. Initially I tried to do this by manually looking through referenced assemblies but realised I didn't have namespace information.</p>
  
  <p>I was expecting the below to work:</p>
  
  <pre><code>  var workSpace = Roslyn.Services.Workspace.LoadSolution(solFilePath);
  
    IDocument file = null;
    IProject proje = null;
  
    Compilation compilation = Compilation.Create("Test");
    List&lt;CommonSyntaxTree&gt; trees = new List&lt;CommonSyntaxTree&gt;();
  
    foreach (var proj in workSpace.CurrentSolution.Projects)
    {
      foreach (var doc in proj.Documents)
      {
        if (doc.FilePath.ToLower() == filePath.ToLower())
        {
          file = doc;
          proje = proj;
        }
        else trees.Add(doc.GetSyntaxTree());
      }
    }
  
    var targetTree = file.GetSyntaxTree();
  
    trees.Add(targetTree);
    var compilation2 = (Compilation)compilation.AddSyntaxTrees(trees);
  
    var semanticModel = compilation2.GetSemanticModel(targetTree);
  
    var root = targetTree.GetRoot();
  
    var className = root.DescendantNodes().OfType&lt;ClassDeclarationSyntax&gt;().ToList().ElementAt(1);
  
    var properties = className.DescendantNodes().OfType&lt;PropertyDeclarationSyntax&gt;()
        .Where(p =&gt; p.Modifiers.Select(syn =&gt; syn.ToString().ToLower() == "public").Count() &gt; 0).ToList();
  
    var typeInfo = semanticModel.GetTypeInfo(properties.First());
  
    var property = properties.First();
  
    var symbol = semanticModel.GetDeclaredSymbol(property);
  
    var symbol2 = semanticModel.GetSymbolInfo(property);
  </code></pre>
  
  <p>Neither <code>typeInfo</code> nor <code>typeSyntax</code> have the information that I need in them, what am I doing wrong here?</p>
  
  <p>This is the class I'm parsing:</p>
  
  <pre><code>   class Foo
    {
      public Bar bar { get; set; }
  
      public Foo() { }
  
      public int GetInt(Bar bar, int ret = 5 ){
        return ret;
      }
    }
  </code></pre>
  
  <p>I'm trying to get Type information on the <code>Bar</code> class which is defined in another assembly.</p>
  
  <p>Thanks for any help.</p>