Re: cast object from typeName

You'll likely have to test circle.GetType() rather than using the "as" operator. Knowing the big picture could help. For example here it seems a ICircle interface could help depending on what exactly you are trying to do. I would likely do something such
as:

Type type = Type.GetType("ActiveTest.Circle");
IShape myShape= Activator.CreateInstance(type) as IShape; // could be any kind of shape maybe, not just a circle so I need to work with shapes
// somewhere later: testing if in addition to being a shape it is a circle to do something special for circles
ICircle circle=myShape as ICircle;
if(circle!=null) etc...

Re: cast object from typeName

Still unclear. The point of using an interface is precisely that you don't care about the actual type as long as it implements this interface. If you want to test for additional capabilities you could use another interface.

For now it seems you expect to be able to use a type name Inside your code even though the actual type that will be used is not know yet (and which seems useless).

So try to explain what you are trying to do (not that you try to cast an object to a not yet known type but the final thing you need to do such as if this is a circle I'll do some special action etc... (in which case using another interface as suggested
above seems better than using an actual type name).

If you don't put any requirement on the type you'll use (no interfaces at all etc...), you could use a "dynamic" object but then you don't know what this object is able to do until runtime.

Is this a kind of plugin system that you are trying to do? If we get the final goal, there is likely a much better approach than the as "type name" you told about to illustrate what you need.

Edit: Basically the idea for a type whose actual name is configurable is most often to put as much requirements as strictly needed (ie that it implements some interfaces or inherits from an abstract class or whatever) but *no more* than stricly needed (ie
using a particular type which finally make your code to work only for this particular type loosing some of the benefit about being able to swap implémentations by configuring the type you want at runtime).

Else use circle.GetType() and compare with a type variable known to be initialized using this particular type but it seems the wrong way to go...