Cast to type dynamically from string name of type

So I'm making a game maker editor where coders will be able to make a DLL that has a class in it that is derived from a specific base class (let's say Behavior). They put their DLL's in a plugin folder and the main game maker exe loads all these DLL's.

Their class can have properties that when they assign an instance of it to a game object they can set the initial values of the properties. This is all done from a grid and using reflection to inspect the properties of the class.

This of course has to be saved to a file at some point to be reloaded when they want to reopen the game maker project or run the game. Ideally the main exe would be able to read in this data and cast the values saved to the correct property type.

I also don't want to ask the programmers of these DLL's to use dynamic for each type. So would this be possible?


ANSWERS:


Why don't you add an interface to Serialize / Deserialize the data into whatever... json, xml, binary and persist them somewhere?



 MORE:


 ? Cast to type dynamically from string name of type
 ? Cast to type dynamically from string name of type
 ? Is there a straightforward way to copy a Type using reflection?
 ? How to create a Dictionary with any types in Type variables?
 ? return generic IEnumerable when passing concrete type parameter for a generic method
 ? How do I check type of dynamic datatype at runtime?
 ? Casting to a generic list of variables of dynamic type
 ? Casting to a generic list of variables of dynamic type
 ? Casting to a generic list of variables of dynamic type
 ? Why does dynamic type work where casting does not?