Thursday, December 20, 2007

DCOM Errors

This is an issue that I've ran in to multiple times now. I haven't figured out the exact reason that these problems start occurring but it seems to be related to running Windows Update.

Here's the issue:

You'll start seeing lots of DCOM errors in your System Log, usually one every minute or so. These errors will look something like this:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{INSERT_GUID_HERE}
to the user DOMAIN\MOSSService SID (INSERT_SID_HERE). This security permission can be modified using the Component Services administrative tool.Basically your MOSS Service account doesn't have the necessary permissions to one of the DCOM services. So let's fix that.

  1. Go to Start > Run. Type "regedit". Click OK.
  2. Select the root node "My Computer".
  3. Select Edit > Find. And paste your GUID from the error in your system log into the search box and click "Find Next". Keep searching until you have a folder on the left and not the actual GUID itself.
  4. Now you know the name of the service that's lacking permissions in my case it was OSearch.
  5. Now go to Start > Administrative Tools > Component Services > Expand Component Services > Expand Computers > Expand DCOM Config
  6. Right click the service you found in my case "OSearch" and choose properties.
  7. Select the "Security" tab.
  8. Under "Launch and Activation Permissions" click "Edit..."
  9. Add your MOSS Service Account and ensure that he has both "Local Launch" and "Local Activation" permissions.
Now you can back up and clear your event log and enjoy an error free event log once again.

Wednesday, November 28, 2007

Deploying Publishing Content Types via Site Definition

First let me say welcome to my blog!

Recently I've been working on a project that involved some heavy branding of a custom publishing site.

I had to create the following custom items:
  • Publishing Site Definitions
  • Master Pages
  • Site Columns
  • Content Types (Using the custom site columns)
  • Page Layouts (Using the custom content types)
  • Images
  • CSS Files
All of this had to be deployable via features and solutions.

To accomplish this I created some custom site definitions and deployed the necessary branding files via a feature that was attached to the site definition. However, when my site definition was created my custom content types were not attached to the pages library resulting in a page that correctly used my page layout but was lacking the support fields behind the scenes.

To remedy this I had to create an additional feature which I called my ContentTypeBindingFeature and attached it to my site definition. This solved my problem.

Example code below:

feature.xml

<?xml version="1.0" encoding="utf-8" ?>
<Feature
Id="INSERT_YOUR_GUID"
Title="Content Type Binder"
Description="Binds a specified content type to the pages library"
Scope="Web"
Hidden="TRUE"
Version="1.0.0.0"
xmlns="http://schemas.microsoft.com/sharepoint/">
<elementmanifests>
<elementmanifest location="ContentTypeBinding.xml">
</elementmanifests>
</feature>

ContentTypeBinding.xml

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ContentTypeBinding ContentTypeId="INSERT_YOUR_CONTENT_TYPE_ID" ListUrl="Pages" />
</Elements>