title: C# ‘dynamic’ cannot access properties from anonymous types declared in another assembly
body: <p>Code below is working well as long as I have class <code>ClassSameAssembly</code> in same assembly as class <code>Program</code>.
  But when I move class <code>ClassSameAssembly</code> to a separate assembly, a <code>RuntimeBinderException</code> (see below) is thrown.
  Is it possible to resolve it?    </p>
  
  <pre><code>using System;
  
  namespace ConsoleApplication2
  {
      public static class ClassSameAssembly
      {
          public static dynamic GetValues()
          {
              return new
              {
                  Name = "Michael", Age = 20
              };
          }
      }
  
      internal class Program
      {
          private static void Main(string[] args)
          {
              var d = ClassSameAssembly.GetValues();
              Console.WriteLine("{0} is {1} years old", d.Name, d.Age);
          }
      }
  }
  </code></pre>
  
  <p><code>Microsoft.CSharp.RuntimeBinder.RuntimeBinderException</code>: <strong>'object' does not contain a definition for 'Name'</strong></p>
  
  <pre><code>at CallSite.Target(Closure , CallSite , Object )
  at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
  at ConsoleApplication2.Program.Main(String[] args) in C:\temp\Projects\ConsoleApplication2\ConsoleApplication2\Program.cs:line 23
  </code></pre>