Thursday, April 02, 2009

Error Enabling MOSS Publishing Feature

I've been working on a new Extranet project (details to follow once it is publicly announced), and I need to enable the MOSS Publishing features. Unfortunately, I ran into the following exception when I tried:

Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))

A little research uncovered extensive conversation about this on Microsoft Technet. The solution suggested was a series of STSADM commands to manually enable the handful of publishing features, and it worked! So, reproduced below to help anyone else who runs into this problem, is the series of commands that make this little problem go away. (Obviously, you'll want to replace http://siteurl with the location of your site collection.)

stsadm -o activatefeature -filename publishing\feature.xml -url http://siteurl -force

stsadm -o activatefeature -filename publishingresources\feature.xml -url http://siteurl -force

stsadm -o activatefeature -filename publishingSite\feature.xml -url http://siteurl -force

stsadm -o activatefeature -filename publishingweb\feature.xml -url http://siteurl -force

stsadm -o activatefeature -filename publishinglayouts\feature.xml -url http://siteurl -force

stsadm -o activatefeature -filename navigation\feature.xml -url http://siteurl -force

I found it helpful to wrap these in a nice little batch file for future use, but you could just as easily run them one at a time.