title: generate source based on other assembly classes (c# source generator)
body: <p>I want to generate a static class that should have a method depending on other classes in specific <strong>reference assembly</strong>.</p>
  <p>a simplified example:</p>
  <pre class="lang-cs prettyprint-override"><code>// Generator.csproj
  [Generator]
     public class MyGenerator : ISourceGenerator
     {
        public void Initialize(GeneratorInitializationContext context)
        {
            // Register a factory that can create our custom syntax receiver
            context.RegisterForSyntaxNotifications(() =&gt; new MySyntaxReceiver());
        }
  
        public void Execute(GeneratorExecutionContext context)
        {
            // var syntaxReceiver = (MySyntaxReceiver)context.SyntaxReceiver;
        }
     }
  
      private class MySyntaxReceiver : ISyntaxReceiver
      {
         ....
      }
  </code></pre>
  <pre><code>// Core.csproj
  // namespace Core.Entities
  class Entity1 : IAccessControl {}
  class Entity2  {}
  class Entity3 : IAccessControl {}
  </code></pre>
  <pre><code>// Persistence.csproj =&gt; has a reference to Core project and the Generator
  // this class should be generated ...
  static class GeneratedClass
  {
     public static void DoSomethingEntity1()
     public static void DoSomethingEntity3()
  }
  </code></pre>
  <p>I want to find the <code>Entity</code> classes in the <code>Core</code> project and generate a class in the <code>Persistence</code> project,
  The problem is my <code>Core</code> project is not accessible and it is already compiled before <code>Persistence</code>. should I use reflection or manually read the Core Entities ? or is there a better way to access SyntaxTree in the <code>Core</code> project?</p>