public override object ForceLoadType(EvaluationContext gctx, string typeName) { // Shortcut to avoid a target invoke in case the type is already loaded object t = GetType(gctx, typeName); if (t != null) { return(t); } SoftEvaluationContext ctx = (SoftEvaluationContext)gctx; if (!ctx.Options.AllowTargetInvoke) { return(null); } TypeMirror tm = (TypeMirror)ctx.Thread.Type.GetTypeObject().Type; TypeMirror stype = ctx.Session.GetType("System.String"); if (stype == null) { // If the string type is not loaded, we need to get it in another way StringMirror ss = ctx.Thread.Domain.CreateString(""); stype = ss.Type; } TypeMirror[] ats = new TypeMirror[] { stype }; MethodMirror met = OverloadResolve(ctx, "GetType", tm, ats, false, true, true); try { tm.InvokeMethod(ctx.Thread, met, new Value[] { (Value)CreateValue(ctx, typeName) }); } catch { return(null); } finally { ctx.Session.StackVersion++; } return(GetType(ctx, typeName)); }