SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

NavBar ID Attrib in ONET.XML file can prevent application of site template


Just For Posterity Department:

I was trying to create my first custom Site Definition. This was my first foray into ONET.XML other wonders.  I thought I was making some simple changes, but creating a site with my new Site Definition (by choosing it from the site template list) kept failing.  In the browser, SharePoint displayed this helpful error message:

 Cannot complete this action.
 
 Please try again.

Mmmmm. Hoping for a little more, I dig into the log folder at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS. It isn't any more helpful.

 Failed to apply template "LICOR_Team_Site#0" to web at URL "http://sandbox1:8081/7", error  0x80004005

<snippet from log file>
10/12/2007 09:46:25.69  w3wp.exe (0x1DE0)                        0x1650 Windows SharePoint Services    General                        72h9 High     Failed to apply template "LICOR_Team_Site#0" to web at URL "http://sandbox1:8081/7". 
10/12/2007 09:46:25.69  w3wp.exe (0x1DE0)                        0x1650 Windows SharePoint Services    General                        72k2 High     Failed to apply template "LICOR_Team_Site#0" to web at URL "http://sandbox1:8081/7", error  0x80004005 
10/12/2007 09:46:25.69  w3wp.exe (0x1DE0)                        0x1650 Windows SharePoint Services    General                        8kh7 High     Cannot complete this action.  Please try again. 
</snippet from log file>

I eventually find out that my problem was in a <NavBar> element. I added a custom NavBar element and, not knowing any better, I changed the ID attribute to the integer 5001. MSDN just says that the param "Specifies the ID" [ http://msdn2.microsoft.com/en-us/library/ms430616.aspx ], so I just picked something not like the others, which were in the 1001-1040 range.

5001 was bad. I don't know why, but there is either a limit to what you can assign OR there was another object not specified in this particular ONET file that conflicted.

Changing my custom NavBar ID to 1030 made my Site Definition work.

Anyone know why?


Posted 10-12-2007 10:10 AM by seanharrison

Comments

SharePoint 2007 Link love: 10-14-2007 at Virtual Generations wrote SharePoint 2007 Link love: 10-14-2007 at Virtual Generations
on 10-14-2007 2:41 PM

Pingback from  SharePoint 2007 Link love: 10-14-2007 at  Virtual Generations

Claudia Gil wrote re: NavBar ID Attrib in ONET.XML file can prevent application of site template
on 10-07-2008 5:28 PM

I got it working using ID=1028, if you put another of the existing IDs like 1003 the link on the nav bar header would go to Documents ... I haven't found a list of all the predefined IDs and using a bigger ID number gives me an error ...

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.