I have a subsite. It has lists, site contenttypes, site columns, list workflows. A lot of list columns are lookup fields. and the DispForm of most of the lists contains Related Item View XSLT WP. Those DispForm are renamed to something else and set as default.
When I tried to create a template using the save as site template include or exclude content., it failed.
Had a look in the log file, it had couple of errors, one being the famous "Attachment" column in workflows list has been deleted by another user...
followings are what I have tried in order to illiminate down what is causing the issue:
1. creating brand new Team Site in the same site collection, save as site template works fine.
2. create some list templates from the my subsite mentioned in the beginning of this post, and created those lists in the new Team Site using the list template. re-created some site columns which are needed for those lists, and remove and re-add those site column in these lists. Then create site template, it works.
3. use the same Team Site from step 2, I then add the Related Item View xsltwp on dispform for one of the list. Create Site Template failed with Errors shown below.
4. use the same Team Site from step 2, on the dispform removed the Related Item View xsltwp, then create site Template succssfully.
So the Error I have got from step 3 are:
Creating Site Template failed with error:
SPSolutionExporter: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SharePoint.SPSolutionExporter.AddViewElementAndAttributes(XmlWriter featureManifestWriter, WebPartSummaryInfo webPartSummaryInfo)
at Microsoft.SharePoint.SPSolutionExporter.WriteModuleElementIntoFeatureManifest(XmlWriter featureManifestWriter, ModuleFolderExportSummaryInfo folderExportSummaryInfoEntry, SortedList`2 fileExportSummaryInfoEntries, Boolean isCustomized)
at Microsoft.SharePoint.SPSolutionExporter.WriteModuleInnerElementsOfElements(ModuleExportSummaryInfo exportSummary, ScopedXmlWriter scopedFeatureManifestWriter)
at Microsoft.SharePoint.SPSolutionExporter.ExportModules()
at Microsoft.SharePoint.SPSolutionExporter.GenerateSolutionFiles()
at Microsoft.SharePoint.SPSolutionExporter.ExportWebAsSolution()
System.InvalidOperationException: Error generating solution files in temporary directory.
at Microsoft.SharePoint.SPSolutionExporter.ExportWebAsSolution()
at Microsoft.SharePoint.SPSolutionExporter.ExportWebToGallery(SPWeb web, String solutionFileName, String title, String description, ExportMode exportMode, Boolean includeContent, String workflowTemplateName, String destinationListUrl)
at Microsoft.SharePoint.SPSolutionExporter.ExportWebToGallery(SPWeb web, String solutionFileName, String title, String description, ExportMode exportMode, Boolean includeContent)
at Microsoft.SharePoint.ApplicationPages.SaveAsTemplatePage.BtnSaveAsTemplate_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I must use the Related Item View XSLT WP on dispforms for this site. and I will need a Site Template for creating other subsite in the same site collection. Any suggestions or workrounds?
Finally the version I am using is Sharepoint 2010 SP2 Dec CU 13.
Regarding the work round, I have now tried export the subsite (of which I couldn't create site template) then import use import-spweb to any new team site. This seems to work well after a quick testing of the newly imported site. I do notice that list workflow is not associated with the list they should be run on in the new site. However all other customizations are looking fine.
I am a bit worried with this work round in terms of if there is any other catches, apart from list workflows...











