title: Using reflection to define property with typeof nested type
body: <p>I am trying to use Refle.emit to generate the following class:</p>
  
  <pre><code>public class Parent {
      public class Child { }
      public Child MyChild { get; set; }
  }
  </code></pre>
  
  <p>So this is what did:</p>
  
  <pre><code>static void Main(string[] args) {
      AssemblyName newAssembly = new AssemblyName("myAssembly");
      AppDomain appDomain = System.Threading.Thread.GetDomain();
      AssemblyBuilder assemblyBuilder =
      appDomain.DefineDynamicAssembly(newAssembly, AssemblyBuilderAccess.RunAndSave);
      ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule(newAssembly.Name);
  
      TypeBuilder parentBuilder = moduleBuilder.DefineType("Parent");
      TypeBuilder childBuilder = parentBuilder.DefineNestedType("Child");
      parentBuilder.DefineProperty("MyProperty", PropertyAttributes.None, childBuilder.CreateType(), null);
      parentBuilder.CreateType();
  }
  </code></pre>
  
  <p>I get an exception: 
  "Could not load type 'Parent' from assembly 'myAssembly'" at parentBuilder.DefineProperty(...,</p>
  
  <p>I didnt find any way to create the parent class without creating the child class in a different assembly. Any suggestions?</p>