private static ConstructorInfo TryGetScriptIgnoreAttributeConstructor() { try { if (AspProxy.IsSystemWebLoaded()) { Type type = Assembly.Load("System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35").GetType("System.Web.Script.Serialization.ScriptIgnoreAttribute"); if (type != (Type)null) { return(type.GetDeclaredConstructor()); } } } catch { } return((ConstructorInfo)null); }
private static ConstructorInfo TryGetScriptIgnoreAttributeConstructor() { try { if (AspProxy.IsSystemWebLoaded()) { var scriptIgnoreAttributeAssembly = Assembly.Load("System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"); var scriptIgnoreAttributeType = scriptIgnoreAttributeAssembly.GetType("System.Web.Script.Serialization.ScriptIgnoreAttribute"); if (scriptIgnoreAttributeType != null) { return(scriptIgnoreAttributeType.GetDeclaredConstructor()); } } } catch { // Intentionally ignore any failure to find the attribute } return(null); }