Re-provisioning the Publishing Feature in MOSS 2007


The Problem

NOTE:  Note that this article does not apply to you if do not have the following features activated:

  1. Office SharePoint Server Publishing (Site Feature)
  2. Office SharePoint Server Publishing Infrastructure (Site Collection Feature)

If you are experiencing one or more of the following symptoms on your Office SharePoint Server 2007 sites, the “publishing” feature of your site is probably in a bad state:

  1. The “Create Page” option is missing from the “Site Actions” menu
  2. The “Modify Navigation” option is grayed out in the “Site Actions” menu (Site Actions –> Site Settings –> Modify Navigation)
  3. You get the “File Not Found” (Exception from HRESULT: 0x80070002) error when performing different operations (such as changing the master page or welcome page).
  4. You get one of the following errors when you attempt to Deactivate the site feature “Office SharePoint Server Publishing”:  
  • Value does not fall within the expected range
  • The given key was not present in the dictionary

The Cause

In most cases, we have seen this to be an issue where a site was created using a team site or a blank site template, and the publishing features were activated on the site afterwards. We have also seen this issue on custom site templates that are using the publishing features. Lastly, this issue can also occur on sites that were upgraded from SPS 2003 to MOSS 2007.

 The Solution

Please follow the steps mentioned here, and that should allow us to re-provision the publishing feature. Although these steps should not cause any data loss, I highly encourage you to test this first before applying this in a production environment:

STEP 1: De-activate the site feature “Office SharePoint Server Publishing”

Following are the steps that need to be performed:

  1. Browse to your site collection
  2. From the “Site Actions” menu, click on “Site Settings –> Modify All Site Settings”
  3. Under “Site Administration”, click on “Site features”
  4. Click on “Deactivate” next to “Office SharePoint Server Publishing”. If you get an error when deactivating the feature, please note the error description.
  5. Go back to the site features page. You will notice that the feature got deactivated even though you got the error. Go ahead and activate the feature again. Feature activation should not throw any errors.
  6. If you got the error “Value does not fall within the expected range” in step 1-4, go to step 2
  7. If you did not get any error,  or got the error “The given key was not present in the dictionary” in step 1-4, go to step 3                                                                                                                                                                                                    

STEP 2: Create the missing libraries

The error "Value does not fall within the expected range" when you deactivate the "Office SharePoint Server Publishing" feature indicates that there are one or more document libraries that are required by the publishing feature, but are not present in your site. To find out all the document libraries in your site, go to Site Actions --> View All Site Content. Following are the document libraries that you should see. If a document library from the list below does not exist in your site, please create the library with the exact same name and go back to step 1. Here is the list:

  1. Documents
  2. Images
  3. Pages
  4. Site Collection Documents
  5. Site Collection Images
  6. Style Library

After creating the missing libraries, please go back to step 1.

STEP 3: Re-provision the Publishing Infrastructure Feature

The error "The given key was not present in the dictionary" when you deactivate the site feature "Office SharePoint Server Publishing" indicates some of the components of the "Office SharePoint Server Publishing Infrastructure" site collection feature are not present in the site collection. Note that unlike the "Office SharePoint Server Publishing" feature which is a site feature, the  "Office SharePoint Server Publishing Infrastructure" is a site collection feature. Please complete the following steps to address this issue:

  1. Browse to the top level site in your site collection
  2. From the “Site Actions” menu, click on “Site Settings –> Modify All Site Settings”
  3. Under "Site Collection Administration", click on "Site Collection Features"
  4. Deactivate the feature "Office SharePoint Server Publishing Infrastructure"
  5. Activate back the feature "Office SharePoint Server Publishing Infrastructure"
  6. Go back to the Site Settings page, and click on "Site Features" under "Site Administration
  7. Deactivate the feature "Office SharePoint Server Publishing" (Note: there should be no errors this time)
  8. Activate back the feature "Office SharePoint Server Publishing"

At this point, the publishing feature should have been provisioned properly. You should see the "Create Page" and "Modify Navigation" options in "Site Actions" menu, and the File Not Found error should also go away.

Happy SharePointing!


Comments (8)

  1. Bryce says:

    Thanks for the post, certainly pointed me in the right direction. One thing to update/note, the Images library in the publish feature is called Images, but is actually PublishingImages behind the scenes. Caused a bit of confusion.

  2. I've been experiencing this problem on a couple of our site collections but not others. I've been through all the steps in this article – certainly the best I've seen on the subject but to no avail.

    The sites I am trying to update are the root sites of a collection, would that make any difference?

  3. Hi Liam,

    Are you able to provision the publishing and publishing infrastructure features without getting any errors? The fact that you are working with root sites should not make any difference to the steps. If you are able to re-provision the features correctly, what problems are you experiencing?

  4. Hi and thanks for getting back to me.

    I get an Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))  when trying to provision the features via Site Features but am able to activate the feature via Central Admin.

    I then get the 'value does not fall within the expected range' error when deactivating even after following all step 2, I'm stuck in a Step1-Step2 infinite loop 🙂

    The only symptom I have is the greying out of the Modify Navigation button.



  5. Hi Liam,

    We should focus on "value does not faill within the expected range". Seems like we may still be missing some required libraries. Please reproduce the error, note the timestamp of the error and look at the SharePoint ULS logs for the error. In there, you should see why we're throwing the value does not fall" error.  It is typically due to a library not being available and we should see the name of that library in the logs.

  6. Thanks, I've figured out which library it was now.

    I'd created the PublishingImages library but mis-spelled publishing.

    Many thanks

  7. Don Drake says:

    I actually found a much easier way to re-provision the publishing features. Anything that was mentioned above did not help me.. I actually used the command line tool to fix the issue (STSADM).

    Stsadm -o deactivatefeature –name PublishingWeb –url >URL< -force

    Stsadm -o activatefeature -name PublishingWeb –url >URL< -force



Skip to main content