I am trying to find a good resource/example of using the SPPersistedObject class (or objects derived from it). I am running into a lot of snafu's, snags, and general "I don't know why this won't work" issues with trying to use the hierarchial object store to store my feature settings in. I have found lots of very simple boiler plate examples, but I am trying to do something a lot more complex and have not found any examples like it. I found a question at StackOverflow that is closely related to (and seeing the same errors) what I am doing, but even that does not offer any further insight nor does it look like the problem has actually been solved. Here is a rundown (from a high level) of what I am trying to do. I have not seen any documentation that describes how to do this. Maybe I shouldn't be doing this at all. I based this off the MSDN documentation about SPPersistedObject that says that the class contains code to:

serialize all its members that are base types, other persisted objects, and collections of persisted objects

I have already run into the fact that the term collections as far as I can tell only means lists and dictionaries since HashSets put the system in a bad place. This is what led me to derive several classes from SPPersistedObject in the hope that I could then string them all together. And now, the rundown.

  1. I have a base BaseFeatureSettings class derived from SPPersistedObject that is persisting a couple of strings.
  2. A class derived from BaseFeatureSettings called SpecificFeatureSettings, this class contains to persisted List<Guid> objects as well as a persisted Dictionary<Guid, PersistedSpecificSettingsCollection>
  3. A base class BaseSettings class derived from SPPersistedObject that persists a Guid, a string, a List<string> a bool and a custom flag enum.
  4. A class derived from BaseSettings called SpecificSettings which persists and int and string.
  5. A collection class PersistedSpecificSettingsCollection that derives from SPPersistedObject and implements IDictionary<Guid, SpecificSettings> which contains a persisted Dictionary<Guid, SpecificSettings>

Basically in my code I am accessing the SpecificFeatureSetting and wanting to update it, and push that back into the store. I am able to access the specific feature, and update the strings that are part of the base class of SpecificFeature, but when I try to update the collection that it is also persisting, the number of items in the collection goes up, but they are always null. I also get another error:

An object in the SharePoint administrative framework, depends on other objects which do not exist. Ensure that all of the objects dependencies are created and retry this operation.

Here is a question I posted earlier on StackOverflow, it contains a code snippet of my class hierarchy (although I have made some minor changes, it should give you a good high level picture of what I have described above).

2 Answers 2


After much searching and even contacting consultants, it appears that the proper answer to this question is "Don't do that". It has been recommended to me to redesign our settings framework and make use of hidden lists to store the settings in. This is the direction I am going to solve this problem. I am adding this answer so that if someone else runs into what I ran into they can at least stop banging their head against a wall far sooner than I did.


Have a look at the example here:

Creating Custom Timer Jobs in Windows SharePoint Services 3.0

  • @Vivek I have looked at that example already, my difficulty is in abstracting that down to multiple levels of derivation from SPPersistedObject. That only goes 1 level. Please take a look at the link to a question I posted at StackOverflow, that gives a concrete example of my class layout (with code). I don't have trouble with the first level, its the 2nd and 3rd levels that are not persisting correctly.
    – pstrjds
    Commented Dec 6, 2010 at 18:50
  • oh, I hope I find something you are looking for and will post that.
    – Vivek
    Commented Dec 7, 2010 at 4:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.