private static Type CheckType(string typeName, Type baseType, System.Xml.XmlNode child) { Type c = ConfigUtil.GetType(typeName, child, true); if (!baseType.IsAssignableFrom(c)) { throw new ConfigurationErrorsException(System.Web.SR.GetString("Type_doesnt_inherit_from_type", new object[] { typeName, baseType.FullName }), child); } if (!HttpRuntime.IsTypeAllowedInConfig(c)) { throw new ConfigurationErrorsException(System.Web.SR.GetString("Type_from_untrusted_assembly", new object[] { typeName }), child); } return(c); }
private static Type CheckType(string typeName, Type baseType, XmlNode child) { // Use BuildManager to verify control types. // Note for machine level browser files, this will only check assemblies in GAC. Type type = ConfigUtil.GetType(typeName, child, true /*ignoreCase*/); if (!baseType.IsAssignableFrom(type)) { throw new ConfigurationErrorsException( SR.GetString(SR.Type_doesnt_inherit_from_type, typeName, baseType.FullName), child); } if (!HttpRuntime.IsTypeAllowedInConfig(type)) { throw new ConfigurationErrorsException( SR.GetString(SR.Type_from_untrusted_assembly, typeName), child); } return(type); }