private SPList iInstallListsAddList(XmlNode ndList, out string error) { error = string.Empty; SPList list = null; try { var sFileName = ApplicationInstallerHelpers.getAttribute(ndList, "FileName"); var sTemplate = ApplicationInstallerHelpers.getAttribute(ndList, "Template"); var sListName = ApplicationInstallerHelpers.getAttribute(ndList, "Name"); var sDescription = ApplicationInstallerHelpers.getAttribute(ndList, "Description"); var lists = (SPDocumentLibrary)oWeb.Site.GetCatalog(SPListTemplateType.ListTemplateCatalog); if (sFileName != string.Empty) { foreach (SPListTemplate template in oWeb.Site.GetCustomListTemplates(oWeb)) { if (template.InternalName == sFileName) { var gList = oWeb.Lists.Add(sListName, sDescription, template); list = oWeb.Lists[gList]; break; } } } else if (sTemplate != string.Empty) { var gList = oWeb.Lists.Add(sListName, sDescription, ApplicationInstallerHelpers.GetTemplateType(sTemplate)); list = oWeb.Lists[gList]; } else { error = "List FileName or Template property not found"; } } catch (Exception ex) { Trace.WriteLine(ex.ToString()); error = "Error: " + ex.Message; } return(list); }