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.
To do this using just a namespace and class name (like in the question), you'll also need to know which assembly contains the class.

If the currently running assembly (or mscorlib) contains the Type, then you can use [Type.GetType(string)](http://msdn.microsoft.com/en-us/library/w3f99sx1.aspx) to get the Type. 

If the Type is contained in a different assembly (ie: a library), then you'll need to use [Assembly.GetType](http://msdn.microsoft.com/en-us/library/y0cd10tb.aspx) instead. This requires having an Assembly instance, however, which can be retrieved via Assembly.Load, or using another type within the assembly.