public static void Main()
var myInstance = (MyInterface)System.Reflection.Assembly.GetExecutingAssembly().CreateInstance("Bar");
Console.WriteLine(myInstance.GetType().ToString());
var myType = myInstance.GetType();
FieldInfo[] list = myType.GetFields();
foreach (FieldInfo f in list)
Console.WriteLine(f.FieldType.FullName);
if (f.FieldType.FullName == "System.String")
f.SetValue(myInstance, "my const string from dict!");
myInstance = (MyInterface)System.Reflection.Assembly.GetExecutingAssembly().CreateInstance("Foo");
Console.WriteLine(myInstance.GetType().ToString());
public interface MyInterface
public class Foo : MyInterface
Console.WriteLine("I am Foo: " + a);
public class Bar : MyInterface
public String b = "adasd";
Console.WriteLine("I am Bar: " + b);