のような要件があり、サイト テンプレートをプログラムで作成する必要があります。プログラムでサイトをテンプレートとして保存しようとすると、以下のエラーが発生します。 「一時ディレクトリにソリューション ファイルを生成中にエラーが発生しました」 . 私はc:\windows\tempディレクトリを完全に制御しています.そして、以下の方法を使用しています:
oWeb.SaveAsTemplate(templateName, templateTitle, tmplDesc, true);
(また)
string solutionFileUrl = SPSolutionExporter.ExportWebToGallery(oWeb,templateName, templateTitle,tmplDesc,SPSolutionExporter.ExportMode.FullReuse,true);
同じ問題に直面しています。
SPContext.Current.Web.SaveAsTemplate(templateName, templateTitle, tmplDesc, true); のようなテンプレートとしてルート Web を保存できます。しかし、サブサイトをテンプレートとして保存する必要があります。
以下は私のULSログダンプです
System.Runtime.InteropServices.COMException: リストが存在しません。選択したページには、存在しないリストが含まれています。別のユーザーによって削除された可能性があります。 Microsoft.SharePoint.WebPartPages.ListViewWebPart.EnsureListAndView(Boolean requireFullBlownViewSchema) の ListViewWebPart.EnsureList() Microsoft.SharePoint.WebPartPages.ListViewWebPart.ShouldSerializeTitle() の Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterListViewWebPart.Write14_ListViewWebPart... ...(文字列 n、文字列 ns、ListViewWebPart o、ブール値 isNullable、
System.Xml.Serialization.TempAssembly.InvokeWriter (XmlMapping マッピング、XmlWriter xmlWriter、オブジェクト o、XmlSerializerNamespaces 名前空間、文字列 encodingStyle、文字列 id) で System.Xml.Serialization.XmlSerializer.S... ....erialize (XmlWriter xmlWriter,オブジェクト o、XmlSerializerNamespaces 名前空間、文字列 encodingStyle、文字列 id) で Microsoft.SharePoint.WebPartPages.WebPart.SerializeXml(XmlWriter ライター、XmlSerializer xmls、ブール値 shouldSerializeAll) で Microsoft.SharePoint.WebPartPages.WebPart.SerializeWebPartXml(ブール値 shouldExcludeSpecialProperties、TextWriter ライター) でMicrosoft.SharePoint.WebPartPages.WebPart.WriteXmlAsUtf8(Boolean shouldExcludeSpecialProperties) Microsoft.SharePoint.WebPartPages.SPWebPartManager.GetWebPartXml(WebPart webPart, Boolean shouldUTF8Encode,Boolean shouldExcludeSpecialProperties, Boolean export) at Microsoft.SharePoint.WebPartPages.SPLimitedWebPartManager.ExportWebPart(WebPart webPart, XmlWriter writer) at Microsoft.SharePoint.SPSolutionExporter... ....GetFilesInFolderTree(SPFolder フォルダー, SortedList2 filesInFolder, List
1 webViews) Microsoft.SharePoint.SPSolutionExporter.GetFilesInFolderTree(SPFolder フォルダー、SortedList2 filesInFolder, List
) に 1 webViews) Microsoft.SharePoint.SPSolutionExporter.GetFilesInFolderTree(SPFolder フォルダー、SortedList)2 filesInFolder, List
1 webViews) で Microsoft.SharePoint.SPSolutionExporter.GetFilesInWeb(String workflowTemplateName) で Microsoft.SharePoint.SPSolutionExporter.GenerateSolutionFiles() で Microsoft.SharePoint.SPSolutionExporter.ExportWebAsSolution() で Microsoft.SharePoint.SPSolutionExporter.ExportWebToGallery(SPWeb web, String solutionFileName, Microsoft.SharePoint.SPWeb.SaveAsTemplate(文字列 strTemplateName、文字列 strTemplateTitle、文字列 strTemplateDescription 、Boolean fSaveData) (TemplateIssueProject.ProjectTemplate.<>c__DisplayClass9.b__6()、Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5)。Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) の b__3() (文字列 webName、文字列 templateName、文字列 template... ...タイトル、文字列 tmplDesc)文字列 templateName、文字列テンプレート... ...タイトル、文字列 tmplDesc)文字列 templateName、文字列テンプレート... ...タイトル、文字列 tmplDesc)
TemplateIssueProject.ProjectTemplate.SiteCreation (文字列 siteName) で TemplateIssueProject.TemplateIssewebpart.TemplateIssewebpart.btnSubmit_Click (オブジェクトの送信者、EventArgs e) で System.Web.UI.WebControls.Button.RaisePostBackEvent (文字列 eventArgument) で System.Web.UI.Page。 ProcessRequestMain (ブール値 includeStagesBeforeAsyncPoint、ブール値 includeStagesAfterAsyncPoint)
で System.Web.UI.Page.ProcessRequest (ブール値 includeStagesBeforeAsyncPoint、ブール値 includeStagesAfterAsyncPoint)
System.Web.UI.Page.ProcessRequest() で System.Web.UI.Page.ProcessRequest(HttpContext コンテキスト) で ASP.WKPSTD_ASPX__1961116010.ProcessRequest(HttpContext コンテキスト) で System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication .IExecut... ...ionStep.Execute() System.Web.HttpApplication.ExecuteStep で (IExecutionStep step, Boolean& completedSynchronously) System.Web.HttpApplication.PipelineStepManager.ResumeSteps で (例外エラー) System.Web.HttpApplication.BeginProcessRequestNotification でSystem.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext,IntPtr moduleData、Int32 フラグ) System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer、IntPtr nativeRequestContext、IntPtr moduleData、Int32 フラグ) で System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletio... ...n(IntPtr pHandler、 RequestNotificationStatus& notificationStatus)
System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion (IntPtr pHandler、RequestNotificationStatus& notificationStatus) で System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper (IntPtr rootedObjectsPointer、IntPtr nativeRequestContext、IntPtr moduleData、Int32 フラグ) で System.Web.Hosting.PipelineRuntime.ProcessRequestNotification (IntPtr rootedObjectsPointer、IntPtr nativeRequestContext、IntPtr moduleData、Int32 フラグ)System.NullReferenceException: オブジェクト参照がオブジェクトのインスタンスに設定されていません。Microsoft.SharePoint.SPSolutionExporter.GetFilesInFolderTree (SPFolder フォルダー、SortedList
2 filesInFolder, List
1 webViews) で Microsoft.SharePoint.SPSolutionExporter.GetFilesInFolderTree (SPFolder フォルダー、SortedList2 filesInFolder, List
1 webViews) で Microsoft.SharePoint.SPSolutionExporter.GetFilesInFolderTree (SPFolder フォルダー、SortedList2 filesInFolder, List
1 webViews) Microsoft で.SharePoint.SPSolutionExporter.GetFilesInWeb(String workflowTemplateName) (Microsoft.SharePoint.SPSolutionExporter.GenerateSolutionFiles() で、Microsoft.SharePoint.SPSolutionExporter.ExportWebAsSolution() で)/SitePages/MyTaskPage.aspx にアクセスするときのアプリケーション エラー、エラー = 一時ディレクトリにソリューション ファイルを生成中にエラーが発生しました。TemplateIssueProject.ProjectTemplate.SiteCreation (文字列 siteName)
で TemplateIssueProject.TemplateIssewebpart.TemplateIssewebpart.btnSubmit_Click (オブジェクトの送信者、EventArgs e) で System.Web.UI.WebControls.Button.RaisePostBackEvent (文字列 eventArgument) で System.Web.UI.Page。 ProcessRequestMain(ブール値 includeStagesBeforeAsyncPoint、ブール値 includeStagesAfterAsyncPoint)System.InvalidOperationException: 一時ディレクトリにソリューション ファイルを生成中にエラーが発生しました。TemplateIssueProject.ProjectTemplate.SiteCreation (文字列 siteName)
で TemplateIssueProject.TemplateIssewebpart.TemplateIssewebpart.btnSubmit_Click (オブジェクトの送信者、EventArgs e) で System.Web.UI.WebControls.Button.RaisePostBackEvent (文字列 eventArgument) で System.Web.UI.Page。 ProcessRequestMain(ブール値 includeStagesBeforeAsyncPoint、ブール値 includeStagesAfterAsyncPoint)
提案/提案をしてください。
よろしく、