In addition to my previous post about this wonderful object, be careful what Type you use to ‘persist’. Please be sure that you don’t use any ‘complex’ types such as a DataTable or UserPrincipal. Otherwise during the storing itself, the following error will be raised:
The platform does not know how to deserialize an object of type System.Data.DataTable. The platform can deserialize primitive types such as strings, integers, and GUIDs; other SPPersistedObjects or SPAutoserializingObjects; or collections of any of the above. Consider redesigning your objects to store values in one of these supported formats, or contact your software vendor for support.
The bad thing about this that you have to know exactly where you have stored (or tried to store ;) the object in order to Unprovision and Uncache and after that Delete the object.
Since I couldn’t find any reference of the object it costed me my config database since when retracting my solution that had this custom SPPersistedObject, it failed. So I couldn’t remove my solution anymore.. even worse.. the feature couldn’t be deactivated as well since SharePoint does some calls to the config database and tries to deserialize the object while it can’t and there will fail.
Technorati Tags: SharePoint