Question

I added a template using,

STSADM -o addtemplate -filename "C:\Stalker\BaleeeBaleee.stp" -title "YouBreakLive"

I can see it in Central Administration in "Custom" site templates when I try to create a new site collection, but after execution of command it says,

Operation completed successfully.

IIS must be restarted before this change will take effect. To restart IIS, open a command prompt window and type iisreset.

Was it helpful?

Solution

My guess would be that SharePoint caches the contents of the template store and an IIS reset is required to rebuild that cache to pick up the new template that you just added.

OTHER TIPS

Yes, it's cache related.

When you execute "addtemplate" from stsadm, the template file is actually saved to the content database. To be specific, it will be added as a custom global web template " SPPersistedCustomWebTemplate" through the SharePoint "SPWebService" object (which is a sort of helper object that helps SharePoint Web Application retrieve and cache data from the content database and also other stuff).

My guess is, since the application pools are already loaded in memory with cached stuff with the help of the SPWebService (application pools are actually associated to this helper service before even being associated to an actual SPWebApplication), an IISRESET guarantees the recycling of the cached objects.

To learn more about how the template is being added, you can reflect against STSADM, and find "SPAddTemplate" class.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top