2
リストテンプレートを使用して新しいドキュメントライブラリを作成することは可能ですが、次のコードを試していますが、テンプレートを使用せずにライブラリを作成するだけです。sharepoint 2013リストテンプレートを使用してドキュメントライブラリを作成するC#
ListTemplateCollection listTemplates1 = context.Site.GetCustomListTemplates(context.Web);
ListTemplate li1;//
context.Load(listTemplates1);
context.ExecuteQuery();
context.Load(site.ListTemplates);
context.ExecuteQuery();
var listTemplate = listTemplates1.First(lt => lt.Name == "<Test>");
ListCreationInformation li = new ListCreationInformation();
li.Title = "XYZZ2";
li.Description = "Created through Code";
li.TemplateFeatureId = listTemplate.FeatureId;
li.TemplateType = listTemplate.ListTemplateTypeKind;
List newList = context.Web.Lists.Add(li);
context.Load(newList);
context.ExecuteQuery();
ありがとうございます。私はあなたのコードをテンプレートを取得しようとしましたが、私はデフォルトのテンプレートを持って、私はそれを使用したいカスタムテンプレート(フォルダ構造を持つドキュメントライブラリを含む)を作成しました。カスタムテンプレートを取得する方法。 –