Question: I am having trouble writing a typeof statement which would be using a variable from a config file the code is like this

```
Type t = new typeof ("My.other.class" + configValue[0]);

```

configValue being the dynamic value I get from the app.config file.

The error I get is "type expected" it is fine if I type out the class directly so I am assuming my formatting is incorrect. How should this be written?

Answer: 
The `typeof` keyword is for compile-time use. Use the [`Type.GetType(string)`](http://msdn.microsoft.com/en-us/library/system.type.gettype.aspx) API instead.
Is this what you're looking for?

```
Type t = Type.GetType("spork");
object myspork = Activator.CreateInstance(t);

```