public override Expression VisitTypeofExpression(ITypeofExpression typeofExpressionParam, IMetadataResolver context) { IDeclaredType declaredType = typeofExpressionParam.ArgumentType.GetScalarType(); if (declaredType == null || !declaredType.IsValid()) { return(base.VisitTypeofExpression(typeofExpressionParam, context)); } string assemblyName = GetTypeAssemblyFullName(declaredType); #if DEBUG if (string.IsNullOrWhiteSpace(assemblyName)) { Console.WriteLine(assemblyName); } #endif string fullyQualifiedTypeName = string.Format("{0}, {1}", declaredType.GetClrName().FullName, assemblyName); Type value = Type.GetType(fullyQualifiedTypeName); return(Expression.Constant(value, typeof(Type))); }