Get variables/properties from a Activator.CreateInstance object?
<p>Here is the code I have :</p>

<pre><code>public class Test
{
   string a;
   int b;
}

public class Test2
{
   string c;
   string d
   int e;
}
</code></pre>

<p>I'm compiling it to a DLL and extracting both Classes with :</p>

<pre><code>var library = Assembly.LoadFrom(libraryPath);
IEnumerable&lt;Type&gt; types = library.GetTypes();
</code></pre>

<p>and then "foreach type in types", I'd like to get a list of my variables but don't know how to do it... I'm trying :</p>

<pre><code>var lib = Activator.CreateInstance(type);
Type myType = lib.GetType();
IList&lt;PropertyInfo&gt; props = new List&lt;PropertyInfo&gt;(myType.GetProperties());

foreach (PropertyInfo prop in props)
{
    // Do something with propValue
}
</code></pre>

<p>"props" is empty all the time...</p>

<p>Any help ?</p>
