I'm trying to create a class using Activator.CreateInstance and cast it to a generic interface it implements.

Why am I getting 'InvalidCastException' at run time (.Net 4.0)?

Here is the code:

```
namespace CastingGenerics
{
    class Program
    {
        static void Main(string[] args)
        {
            var typeFromSomewhere = typeof(ActionSomethingValidator);

            // This line throw 'System.InvalidCastException'
            // "Unable to cast object of type 'CastingGenerics.ActionSomethingValidator' to type 'CastingGenerics.IActionValidator`1[CastingGenerics.IAction]'."
            var castingError = (IActionValidator<IAction>)Activator.CreateInstance(typeFromSomewhere);
        }
    }

    internal interface IAction
    {
    }

    internal interface IActionValidator<in T>
        where T : IAction
    {
        bool Validate(T action, out string failure);
    }

    internal abstract class ActionValidator<T> : IActionValidator<T>
        where T : IAction
    {
        public abstract bool Validate(T action, out string failure);
    }

    internal class ActionSomethingValidator : ActionValidator<IActionSomething>
    {
        public override bool Validate(IActionSomething action, out string failure)
        {
            failure = string.Empty;
            return true;
        }
    }

    internal interface IActionSomething : IAction
    {
    }
}

```