C# 列表模板未应用于新的Sharepoint列表

C# 列表模板未应用于新的Sharepoint列表,c#,sharepoint,console-application,sharepoint-list,C#,Sharepoint,Console Application,Sharepoint List,正在使用SharePoint.client创建SharePoint列表,但未应用该模板。我在新列表中没有看到任何字段/列。有人问了一个类似的问题,但它的答案对我不起作用。非常感谢您的帮助 using (ClientContext context = new ClientContext(SITE)) { Web web = context.Web; context.Load(web); cont

正在使用SharePoint.client创建SharePoint列表,但未应用该模板。我在新列表中没有看到任何字段/列。有人问了一个类似的问题,但它的答案对我不起作用。非常感谢您的帮助

        using (ClientContext context = new ClientContext(SITE))
        {
            Web web = context.Web;
            context.Load(web);
            context.ExecuteQuery();

            ListTemplate template = null;
            ListTemplateCollection ltc = context.Site.GetCustomListTemplates(web);
            //ListTemplateCollection ltc2 = web.ListTemplates;
            context.Load(ltc);
            context.ExecuteQuery();

            foreach (ListTemplate t in ltc)
            {
                if (t.Name == "My_Template")
                {
                    template = t;
                    break;
                }
            }

            var listCreationInfo = new ListCreationInformation
            {
                Title = "Test_List",
                Description = "Test"
            }; 
            //ListTemplate listTemplate = ltc.First(listTemp => listTemp.Name.Contains("My_Template"));
            listCreationInfo.TemplateFeatureId = template.FeatureId;
            listCreationInfo.TemplateType = template.ListTemplateTypeKind;


            listCreationInfo.QuickLaunchOption = QuickLaunchOptions.On;                
            List oList = web.Lists.Add(listCreationInfo);
            context.ExecuteQuery();
    }

“你找到解决办法了吗?”“还没有!尝试了很多事情,但都没有成功。几乎一年后,我还没有找到解决办法,我也没有运气。我想我将结束按代码编写模板的工作,您知道,直接从代码而不是模板中应用所有列和视图。我的模板中有一些外部列,这是最难的part@Mr.我甚至不能这样做,因为有一个工作流与该模板关联。工作流有很多条件,需要我付出巨大努力才能在.NET代码中重新创建它。