After creating a site template with contents, SharePoint tells me that everything went OK, and prompts me to go to the Solution Gallery. However, it is empty. Try as I might, I cannot create a site template through the user interface. The Publishing features are disabled and the "Save site as template" option does appear in the site settings. If I use PowerShell, I get the following message:
Exception calling "SaveAsTemplate" with "4" argument(s): "Error generating solution files in temporary directory."
SPSecurity.RunWithElevatedPrivileges
method. Refer this MSDN article: msdn.microsoft.com/en-us/library/…