Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
1  
Interesting question, always taken that as granted. Will be nice if someone explains the inner workings of it. –  SPArchaeologist Dec 19 '12 at 11:53
1  
Well, the stsadm requested that clearly. You may be more successful asking about the reason in MS Connect forums if no MS employee reads this. –  Ferdinand Prantl Dec 19 '12 at 12:14

2 Answers 2

up vote 4 down vote accepted

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.

share|improve this answer
    
Caching is what immediately sprang to mind for me as well.. –  Kit Menke Dec 19 '12 at 14:35
    
Yes - it could really be the blob-cache. I have a vague memory of having flushed the blob cache thus the central admin command and avoided the need for an iisreset. Take this with a grain of salt - it may also be my memory playing triks. –  SPArchaeologist Dec 20 '12 at 9:08

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.