Wednesday, July 25, 2007

MOSS: The importance of the Template Name attribute

Our client decided to change the name of their MOSS solution towards the end of our project, so I had the fun task of renaming visible instances of the old product name.

A relatively brief find and replace session later, I was trying to redeploy our site when I encountered the error

Failed to instantiate file "default.master" from module "DefaultMasterPage": Source path "default.master" not found. at Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String bstrUrl, String& bstrWebTemplate, Int32& plWebTemplateId)

at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String& bstrWebTemplate, Int32& plWebTemplateId)

As Bjarne L. Gram discovered, this was due to the fact that I had changed the name of my Template tag in the Webtemp***.xml file, so that it was no longer matching the folder name in {12-hive}\SiteTemplates.

Thanks to Bjarne for pointing this out; I added a comment to the MSDN documentation.

Labels: , , ,