public static void IsInstanceOfType(Type t, object instance) { #if NETFX_CORE if (!instance.GetType().IsAssignableFrom(t)) { throw new Exception("Not instance of type"); } #else Assert.IsInstanceOf(t, instance); #endif }